Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a Linux VPS, DirectAdmin as web panel and already set a domain to it. everything is OK and I can see my website in my browser using domain name.

Now I need to have access to my site using its IP address. something like http://86.57.88.29, but when I try to load my site in a browser using its IP I get below message and I have to post-fix my IP with /~admin (http://86.57.88.29/~admin) to get it work.

This IP is being shared among many domains. To view the domain you are looking for, simply enter the domain name in the location bar of your web browser.

So how can I configure my IP to point to my public_html folder without and ~admin like phrase?

Thanks.

share|improve this question
    
IP is being shared among many domains. In other words name based VHost. Which means it only knows which website to load if it is accessed using a host/domain name. You cannot contact it by IP, it hasn't been set up to resolve to a default host if contacted without a host/domain name, thus the recommended need to append the home folder. –  Fiasco Labs Jun 19 '12 at 14:35
add comment

1 Answer

A domain always points only to an IP address, nothing more, so there is nothing you can configure.

What you want to do, is to configure your web server. As you have already noticed, it is set up to serve multiple domains from one IP. In Apache this configuration is called NameVirtualHost, other web servers will handle it similarly. What happens is, that the webserver listens at a given IP, and when a request comes in, it compares the requested domain with the defined virtual hosts.

Your workaround can be to define a virtual host based on the IP-address and serve content from it. But it may be a bad idea and is also the reason, why you are seeing the quoted message. The whole name based virtual hosts only work with the HTTP protocol 1.1, older clients with HTTP 1.0 are not supported. It is therefore common practice not to serve content from a pure IP request, when the IP is also being used for name based virtual hosts. Otherwise an old client, requesting one of the domains might be served content that was meant to be delivered when requesting the IP.

share|improve this answer
    
It's not bad idea. I have to do this. because there is a hardware device and according to its manual it needs web server IP to access required file. –  silvercover Jun 19 '12 at 8:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.