WAMP vhost issues with all vhost pointing to the first vhost statement

Posted by Rick on Super User See other posts from Super User or by Rick
Published on 2012-12-15T18:45:38Z Indexed on 2012/12/15 23:07 UTC
Read the original article Hit count: 518

Filed under:

I am trying to setup vhosts in WAMPSERVER and I am running into an issue where all sites are pointing to the first vhosts and not delegating properly. Has anyone had this issue?

Here is my setup.

In windows hosts file:

127.0.0.1 siteabc.local
127.0.0.1 sitexyz.local

In httpd-vhosts.conf:

<VirtualHost 127.0.0.1>
    DocumentRoot "C:\Users\Rick\Documents\Projects\siteabc"
    ServerName siteabc.local
    ErrorLog "logs/siteabc-error.log"
    CustomLog "logs/siteabc-access.log" common
    <Directory "C:\Users\Rick\Documents\Projects\siteabc">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost 127.0.0.1>
    DocumentRoot "C:\Users\Rick\Documents\Projects\sitexyz"
    ServerName sitexyz.local
    ErrorLog "logs/sitexyz-error.log"
    CustomLog "logs/sitexyz-access.log" common
    <Directory "C:\Users\Rick\Documents\Projects\sitexyz">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost 127.0.0.1>
    DocumentRoot "C:\Users\Rick\Documents\Projects"
    ServerName localhost
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" common
    <Directory "C:\Users\Rick\Documents\Projects">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Allow from all
    </Directory>
</VirtualHost>

Ok so from this setup going to siteabc works...but going to sitexyz, it still goes to siteabc. Not sure what I did wrong here.

Thanks for looking.

© Super User or respective owner

Related posts about wamp