How to make multiple sites on WAMP

1.Open
C:\wamp\bin\apache\Apache2.2.21\conf\httpd.conf
2.Uncomment this line
# Include conf/extra/httpd-vhosts.conf
to this
Include conf/extra/httpd-vhosts.conf
3.Open
C:\wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf
add at bottom
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/wamp/www"
    ServerName localhost
    ErrorLog "logs/error.log"
    CustomLog "logs/access.log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/wamp/www/web1"
    ServerName web1
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "c:/wamp/www/web2"
    ServerName web2
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
4.Create web1, web2 folder under c:/wamp/www
Inside Folder web1 create index.html
Input this code
<html>
<body>
asdf
</body>
</html>
Inside Folder web2 create index.html
Input this code
<html>
<body>
asdf 2
</body>
</html>
5.Edit C:\Windows\System32\drivers\etc\hosts
Add at bottom
127.0.0.1       web1
127.0.0.1       web2
5.Restart wamp by right click Wamp and Restart All Services
6.Visit http://web1 and http://web2 on your browser
Other References
http://speedydan.co.uk/tutorials/set-multiple-virtual-hosts-wamp/

Leave a Reply

Your email address will not be published. Required fields are marked *