0

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.

1
  • 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. Jun 19, 2012 at 14:35

1 Answer 1

1

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.

1
  • 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. Jun 19, 2012 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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