How to Create a Project or Virtual Host with WAMP

The release of WampServer 2.5 greatly improved the virtual server’s speed which was already fast to begin with. Also, with the new process of creating Projects or Virtual Hosts, you can now have URLs like http://mytest instead of the old http://localhost/mytest which is a great improvement especially for users like me who play with WordPress Plugins.

  • Step 1

    Once you get WampServer or WAMP installed, go to the installation folder then locate the www folder. This is where all your virtual website’s file are going to be stored. Inside the www folder create a new folder. Name it anyway you want. In the example below we’ll use the name wp-one.

  • Step 2

    Make sure WAMP is running then right-click its icon on the Taskbar then go to Apache then open httpd.conf (OR) you could also manually open that file on this location: /wamp/bin/apache/apachexxx/conf/httpd.conf

    Once the file is open in your text editor, find this line:

    # Include conf/extra/httpd-vhosts.conf

    then change it to this:

    Include conf/extra/httpd-vhosts.conf

    You simply remove the # sign thereby uncommenting it. You’ll only do this step once.

  • Step 3

    Locate and open another file:
    /wamp/bin/apache/apachexxx/conf/extra/httpd-vhosts.conf

    Then add this code at the bottom:

    <VirtualHost *:80>
       DocumentRoot "d:/wamp/www/wp-one"
       ServerName wp-one
       <Directory "d:/wamp/www/wp-one">
          AllowOverride All
          Require local
       </Directory>
    </VirtualHost>

    Note: d:/wamp/www/wp-one is the path to the folder we created on Step 1.

  • Step 4

    Open your Windows Host file with your text editor.
    C:\Windows\System32\drivers\etc\hosts
    Add these two lines:
    127.0.0.1 wp-one
    ::1 wp-one

  • Step 5

    Restart WAMP Server so that it could pick up the changes. You can now check your new Project website on your browser. http://wp-one/

To add another Project or Virtual Host repeat the steps above except for Step 2.

Share This Post

7 Comments

Add a Comment
  1. I want to do several projects in wordpress. Will I have to do new databases?
    Thank you

    1. Yes. One for each of your projects.

  2. I’m at Step 4 and added the lines in but it does not allow me to save the changes citing that I do not have permission to do so. And now, I couldn’t even launch the localhost to view the projects. Please advice. Thank you

    1. Run notepad.exe as administrator then open the host file. You should be able to save the changes.

  3. It’s a good lesson。I get it ,thank you!

Leave a Reply

Please write your comments in english. I delete anything that even remotely resembles spam.

Note: When posting code, enclose it in pre and code tags.
e.g. <pre><code> Add code here </code></pre>