I will demonstrate how to host more then one site on WAMP. I believe that WAMP is up and running on your window machine.
Suppose you want to host, say
We will consider all the file one by one that need to be modified:
Go to “C:/Windows/System32/drivers/etc” and open the “hosts” file in Notepad and add the following lines.
- 127.0.0.1 my.localhost
Open “C:/wamp/bin/apache/ApacheX.X.XX/conf/ (X.X.XX denotes your apache version.)
Search for these two lines:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
Remove “#” from second line above and save and close the httpd.conf file. This tells Apache to include the file “httpd-vhosts.conf”
Go to “C:/wamp/bin/apache/ApacheX.X.XX/conf/extra” and open the file “httpd.vhosts.conf”.
Add the lines to the file:
CustomLog “logs/localhost-access.log” common
CustomLog “logs/my-access.log” common
DocumentRoot should map to the directory of the project that need to be accessed via web browser for particular host entry (i.e. where you code entry path exist.)
Also, if you need to serve the virtual host on a non-standard port, change it in the VirtualHost directive line.
After you add the above code to the correct file, save it and restart your WAMP services. Now you should be able to see both localhost and my.localhost from your browser.