Virtual Host using WAMP server

First thing you need to do is install a latest wamp server on your system.
Once setup is done. Start the WAMP server.
Default link to access WAMP server is http://localhost/.
Now if you create a new website folder under htdocs named website so the default link to run the new project is http://localhost/website
If you want to rename the link from http://localhost/website to suppose that is creating a virtual host you need to follow below steps:

  1. Goto your My Computer > C > windows > system32 > drivers > etc
    Edit hosts file using admin rights
  2. Once hosts file is opened. Right at bottom of file add following code is host name which i want to run as and save the file
  3. Then, Go to wamp installation folder: apache >conf  > extra
    and edit httpd-vhosts.conf file
  4. Once file is opened as following code at bottom of file. This code gives permission to virtual host to folder
    <directory C:/wamp/www>
    Order Deny, Allow
    Allow from all
    <VirtualHost *:80>
    DocumentRoot “C:\wamp\www\website”
  5. Now restart your server and run host as and it will point to www/website folder.


Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>