Minggu, 29 April 2012

How To Create Virtual Host in WAMP

imageYou probably want to host multiple test websites on your machine. By default, WAMP isn’t really set up for this, but a few relatively simple changes to the httpd.conf and hosts file will remedy this.
Make sure that ‘LoadModule vhost_alias_module modules/mod_vhost_alias.so‘ has been uncommented in the httpd.conf file.
At the bottom of your httpd.conf file, add the following…
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot C:/wamp/www/%0
#VirtualScriptAlias C:/wamp/www/hosts/%0/cgi-bin


This is assuming that you installed WAMP with the default settings.


Open up your www folder (C:\wamp\www) and create a new website folder.


Hit start, open up the following file with notepad ’C:\windows\system32\drivers\etc\hosts’ and add the following line to the bottom:


127.0.0.1 sitename (whatever you named the folder above)


That’s all, now you have your own virtual host in WAMP! Hope it helps… :)

Leave a Reply

 
 

Followers