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?
ServerName www . example1.com
ServerName www . example2.com
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
Excellent, just what I was looking for.