Results 1 to 4 of 4
I have setup apache2 on a new VPS. The server has 1 IP address but I am hosting 2 websites from it. The websites work fine but when someone enters ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-14-2012 #1Just Joined!
- Join Date
- Jun 2012
- Posts
- 6
Apache2 Config
I have setup apache2 on a new VPS. The server has 1 IP address but I am hosting 2 websites from it. The websites work fine but when someone enters the server IP into the browser it loads one of the websites. I want it to load a holding page instead of the websites.
How do I do this?
Sample...
Code:NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /www/example1 ServerName www . example1.com </VirtualHost> <VirtualHost *:80> DocumentRoot /www/example2 ServerName www . example2.com </VirtualHost>
- 06-14-2012 #2Linux Newbie
- Join Date
- Jan 2012
- Location
- Ohio
- Posts
- 175
Apache will always load the first listed virtual host if you have virtual hosts turned on when the IP address is typed in. Create a new virtual host and put it before any others and make the document root the folder containing the page you want to load. You only need the document root.
Here is a quick example:
apache - Automatic holding page for any sites pointing to my IP - Stack Overflow
- 06-14-2012 #3Just Joined!
- Join Date
- Jun 2012
- Posts
- 6
Excellent, just what I was looking for.
Thanks KTech!
- 06-15-2012 #4Linux Newbie
- Join Date
- Jan 2012
- Location
- Ohio
- Posts
- 175
Glad to help!


Reply With Quote
