Setting Up Virtual Hosts in Windows

August 17, 2009
  1. Open up the main Apache main configuration file to enable virtual hosts.
    C:\wamp\bin\apache\Apache2.2.11\conf > open httpd.conf > enable virtual hosts (uncomment Include conf/extra/httpd-vhosts.conf)
  2. open hosts file and edit the text to include the new domain -  e.g.  127.0.0.1 ayanthi.anandagoda.tv
    Go to C:\WINDOWS\system32\drivers\etc
  3. Add a new entry in httpd-vhosts.conf to point to the new document root.
    C:\wamp\bin\apache\Apache2.2.11\conf\extra > open httpd-vhosts.conf

    <VirtualHost *:80>
    DocumentRoot “C:\wamp\www\ayanthi.tv”
    ServerName ayanthi.anandagoda.tv
    </VirtualHost>

Thanks Thilanga for your generous help.

Leave a Reply