Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: Help with Apache VirtualHosts. Using 1 IP for two sites. One is not loading

  1. #21
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Help with Apache VirtualHosts. Using 1 IP for two sites. One is not loading

    Quote Originally Posted by Kolipoki View Post
    Please someone correct me if I'm wrong.
    I believe you are wrong. That is what the ServerAlias directive is for.
    http://httpd.apache.org/docs/2.2/mod...tml#servername
    http://httpd.apache.org/docs/2.2/mod...ml#serveralias

  2. #22
    Join Date
    Feb 2009
    Location
    Texas
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Help with Apache VirtualHosts. Using 1 IP for two sites. One is not loading

    The SeverAlias instruction did the trick on my fake2 file

    Now fake2 file looks like this

    Code:
    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
            ServerName www.fake2.com
            ServerAlias fake2.com
            DocumentRoot /var/www/fake2.com/docs
    
            <Directory /var/www/fake2.com/docs>
                    Order Deny,Allow
                    Allow from all
                    # Don't show indexes for directories
                    Options -Indexes
            </Directory>
    </VirtualHost>
    Now, if I skip the "www" on fake2.com in my browser, it will retrieve the right content anyway NOT fake1.com

Page 3 of 3 FirstFirst 123

Tags for this Thread

Bookmarks

Posting Permissions

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