We are running Apache on a server with multiple
VirtualHost entries. Whenever someone access the server by it's IP address (
http://198.147.xx.xx), one of the websites that is a
VirtualHost comes up. This is not desired. We would rather a blank page come up if the IP is accessed directly. I'm not sure if the chosen site is just the first one that comes in the list of Virtual Host entries or what.
We want to setup a default, blank page if someone access the server by IP. I thought that simply setting up another
VirtualHost entry for the IP address would do it, and it seemed to, but now accessing any of the other
VirtualHost sites leads to the same blank, default page. Here is an example of our config:
<VirtualHost *:80> DocumentRoot /vhosts/somesite.com/public ServerName somesite.com <Directory "/vhosts/somesite.com/public"> allow from all Options +Indexes AllowOverride All </Directory> ServerAlias www.somesite.com </VirtualHost> <VirtualHost 198.147.XX.XX:80> DocumentRoot /vhosts/default/public <Directory /vhosts/default/public> allow from all Options +Indexes </Directory> </VirtualHost>
What are we doing wrong here? Is there a better way to setup a default landing page for anyone accessing the server via IP address?