default website on IP

Probably a very simple answer - one of my clients - - has asked why when you type in do you get the site? Is that some sort of default?

I have all the sites set-up on a shared IP , i would presume this would cause the issue , however why would site get shown on the default IP rather than any of the other site sharing that IP , and how can this be changed,fixed?

Yup, it’s the default setup in Server Configuration -> Website Options -> Default website for IP address.

If you haven’t set that, it defaults to the first entry on that IP that Apache sees.


sorry i should have mentioned im using virtualmin


Here’s what I did in my configuration in order to setup a specific page to show for the IP address when entered.

  1. Go to: Webmin > Servers > Apache Webserver > Create virtual host

  2. For “Handle connections to address” choose “Specific address”, enter the IP address.

  3. For “Port” click the radio option next to the field, then enter 80.

  4. For “Document Root” specify the server directory where the default website is located.

  5. Click “Create Now”

  6. Finally click “Apply Changes” (upper right corner)

This will ensure that traffic to the IP address is shown the website you specified.

Repeat these steps for any other IP address(es) and/or ports you want to set defaults for.

*** These rules work with Virtualmin GPL, and don’t worry Virtualmin won’t overwrite them later. ***

– Peter

how would I make “Default website for IP address” be served from /var/www/html ?

setting “Automatic Virtual Hosts” for the default website to /var/www/html essentially disables all other vhosts: every request (with a proper domain name that matches an active vhost) is sent to that empty directory. it doesnt matter if i check “Use IP address instead of hostname” or not.

so my question still stands.


peter’s solution doesnt work once you already have a vhost setup as “Default website for IP address” in “Website Options”. it seems that the only way to take that priority from another vhost is to create a vhost for the IP address in VIRTUALMIN (creating it in webmin, as suggested above, doesnt make the vhost show up in virtualmin therefore it can’t be selected as the “Default website for IP address”)

ideas? anyone?

thanks in advance

Peter is almost right.

The trouble is that Apache just trolls down its list from the top for a site matching the IP so you need to give your specially created virtual server (as per his instructions above) a name that puts it first in the list (after the Any address entries).

For example, name the server ‘AAAMeFirst’ and you will then get the required behaviour.

Don’t worry i will help you …Even though many sites hosted under a shared ip,if it displaying a particular site,it is because the default server configuration.So that only when you typed the particular ip address it is displaying the resolve (fix) this issue/problem you can change the settings in the server.So it will not display the website,if you type the shared ip address.You can check the ip address of domain names hosted in shared ip using the site
Here you can enter the domain name and it will display the particular Internet Protocol Address(IP-address).