Install virtual hosts on Wamp

  • SumoMe

Today I will show you how to install virtual hosts on Wamp server.

First open your hosts file, you can find it in this folder:
C:\Windows\System32\drivers\etc
to edit it you need to have administrator permissions.

After this line:
127.0.0.1 localhost
add new one with name of your domain:
127.0.0.1 test.local
I prefer to use .local for my virtual domains to know is that virtual or real domain name.
Next step is to open httpd.conf file which is locate in:
\wamp\bin\apache\Apache2.2.17\conf
find this line:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
to enable httpd-vhosts.conf just remove # at the begin of the row. After this open httpd-vhosts.conf for edit.
Add this:

<VirtualHost *:80>
DocumentRoot "C:/wamp/www/test/www"
ServerName test.local
ServerAlias www.test.local
<Directory "C:/wamp/www/test/www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from 127.0.0.1
</Directory>
</VirtualHost>

Restart your Wamp server and type in your browser test.local .

Leave a Reply


*