default website on IP

8 posts / 0 new
Last post
#1 Wed, 10/21/2009 - 03:54
daveslist

default website on IP

Probably a very simple answer - one of my clients - blahblah.ie - has asked why when you type in http://123.123.123.123 do you get the billybob.ie 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 billybob.ie get shown on the default IP rather than any of the other site sharing that IP , and how can this be changed,fixed?

Wed, 10/21/2009 - 09:13
andreychek

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.

-Eric

Wed, 10/21/2009 - 09:30
daveslist

sorry i should have mentioned im using virtualmin

Wed, 10/21/2009 - 12:37
tpnsolutions
tpnsolutions's picture

Hi,

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

Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Sat, 05/08/2010 - 12:51
eddieb

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.

thanks

Thu, 05/13/2010 - 11:24
eddieb

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

Tue, 02/08/2011 - 18:36
whippy

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.

Sat, 02/16/2013 - 05:04
venus

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 billybob.ie.To 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 Ip-details.com Here you can enter the domain name and it will display the particular Internet Protocol Address(IP-address).