Find the answer to your Linux question:
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.
  1. #1
    Just 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>

  2. #2
    Linux 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

  3. #3
    Just Joined!
    Join Date
    Jun 2012
    Posts
    6
    Excellent, just what I was looking for.

    Thanks KTech!

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Jan 2012
    Location
    Ohio
    Posts
    175
    Glad to help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •