PDA

View Full Version : WAMP Virtual Hosts


haydo
12-02-2009, 10:04 AM
Hi Guys,

I'm having to make a virtual host in wamp. Usually I use MAMP Pro which is just a few clicks and it's done but having to use a windows machine at the moment.

I've googled high and low and tried all solutions but no success, so trying my luck here.

I've changed the windows hosts file as follows:


127.0.0.1 localhost
127.0.0.1 dev.test.com
::1 localhost


And at the moment i'm trying the method of adding the virtual host lines at the bottom of the http.conf file as follows:


<VirtualHost *:80>
DocumentRoot "C:/Web Projects"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
ServerName dev.test.com
DocumentRoot "C:/Web Projects/test"
</VirtualHost>


The usual localhost works, however that's just coming from the document root i have set in http.conf.

Can anyone enlighten me why my virtual hosts are not working? I'm guessing it's a stupid mistake!

Thanks guys!

Inigoesdr
12-02-2009, 03:03 PM
Make sure you have the NameVirtualHost directive set:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName my.dev
DocumentRoot "D:/www/test"
</VirtualHost>
Also, restart Apache after you edit the config file to make sure the changes are picked up. Are you getting to your localhost when you type in the dev.test.com domain?

haydo
12-02-2009, 07:09 PM
Hi Inigoesdr, thanks for your reply :)

I reset the WAMP after every change and did name the Virtual Host directive. When i go to dev.test.com i simply get the page not found error.

I've followed multiple tutorials on line with no success. Very frustrating!

haydo
12-06-2009, 06:32 AM
Any ideas guys? To me it seems as if it's ignoring my hosts file.

haydo
12-12-2009, 07:21 AM
It appears to be ignoring my windows host file.

I can change the localhost settings vh settings fine, just when i try to add a new vh.

adimsh
12-29-2009, 09:46 AM
it is recommended not to use folders with spaces, to be able to help you more, please attach your httpd.conf file.

Regards,