two aliases pointing to the same document root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

I have been using apache for my local web development for some time,
and I am very happy with it.  I am trying something new, and have run
into a bit of trouble.

I am responsible for multiple web sites, and use the httpd-vhosts.conf
to point to different document roots for each site.  I also use
entries in my local hosts file to point to the different sites.  For
instance:
127.0.0.1	website1_com
127.0.0.1	website2_com

This has worked fine so far.  Now I am trying to have two different
aliases point to the same document root.  On the live site, we will
have multiple domains pointing to the same web server, and serve
content that is slightly different based upon domain name.  I am
trying to get my development environment to simulate this.

Here is what I have in my httpd-vhosts.conf file:
<VirtualHost *:80>
    ServerAdmin webmaster@xxxxxxxxxxxxxxxxxxxxxxx
    DocumentRoot "C:\Inetpub\wwwroot\website1_com"
    ServerName website1_com
    ServerAlias website1_com
    ErrorLog "logs/website1_com-error.log"
    CustomLog "logs/website1_com-access.log" common
</VirtualHost>


<VirtualHost *:80>
    ServerAdmin webmaster@xxxxxxxxxxxxxxxxxxxxxxx
    DocumentRoot "C:\Inetpub\wwwroot\website1_com"
    ServerName website2_com
    ServerAlias website2_com
    ErrorLog "logs/website2_com-error.log"
    CustomLog "logs/website2_com-access.log" common
</VirtualHost>

Please note that the document root is set to the same thing for both
entries.  When I go to http://website1_com/, the proper site is
served.  However, when I go to http://website2_com/, I just get the
directory listing of the root, c:\Inetpub\wwwroot\.

What am I doing wrong?

Thanks.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux