- Step 1.
- Edit hosts file to map virtual host name to ip address.
add 127.0.0.1 xxxxx.localhost
i have used vinod.localhost
Location:C:\Windows\System32\drivers\etc\hosts -

- In vista, run the notepad in administrator mode to edit hosts file.

- Step 2.
- Edit Apache configuration file httpd.conf to add server name and document location for virtual hosts.
after DocumentRoot “c:/wamp/www/” in httpd.conf, add -
NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> ServerName localhost DocumentRoot "c:/wamp/www" </VirtualHost> <VirtualHost 127.0.0.1> ServerName vinod.localhost DocumentRoot "c:/wamp/www/vinod/" </VirtualHost>
-

- Step 3.
- create your project folder at the destination folder specified.
- Step 4.
- Restart Apache server for changes to take effect.
- Step 5.
- Nothing here
. http://vinod.localhost/ should serve the files in c:/wamp/www/vinod/ now. -

Setting Up Virtual Hosts in Wamp Server
Jul 29th, 2009 by Vinod Pandey