views:

320

answers:

2

If you're reading my question, thanks, I appreciate your help

I'm using Wamp on Windows Vista.

I've created 2 project folders:

www/project1/ 
www/project2/

My virtual hosts file looks like this:

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www/project1/"
    ServerName project1.com
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www/project2/"
    ServerName project2.com
</VirtualHost>

Can someone advise how I can go about doing this?

A: 

You need to specify ServerName in VirtualHost like this (and additionally ServerAlias) for each hostname:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host1.localhost"
    ServerAlias *.first.com first.com
    ServerName www.first.com
    ErrorLog "logs/dummy-host1.localhost-error.log"
    CustomLog "logs/dummy-host1.localhost-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
    ServerAlias *.second.com second.com
    ServerName www.second.com
    ErrorLog "logs/dummy-host2.localhost-error.log"
    CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
David Kuridža
Sorry pal, but what you're suggesting isn't working for me. See my Edit above in the original post. If you can help out from there, that would be great.
Chris
Hosts file must map first.com and second.com to localhost:127.0.0.1 first.com127.0.0.1 second.comYou need to make sure your local DNS is refreshed as welll; restart browser and restart dnscache service.
David Kuridža
A: 

Hi there,

I have a full tutorial on our website, let me know if you have any problems by leaving a comment on our blog.

http://www.kintek.com.au/web-design-blog/configuring-multiple-domains-within-wamp-for-local-development/

Maurice