setup WAMP

How to setup WAMP virtual hosts

In this tutorial, I will be showing how to install WAMP or port 8080 (default port is 80) and how to setup WAMP. For me basically everything went fine. The problem I encountered was when setting up the virtual hosts. Download WAMP here and Install. Use a good text editor such as Sublime Text

1. Navigate to C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf and edit lined no 513, simply remove # sign in front of the line. This will enable virtual hosts

Include conf/extra/httpd-vhosts.conf

2. Navigate to line 240 and change the code as follows (change denied to granted). This will fix the issues you might encounter later when setting up virtual sites.

<Directory />
AllowOverride none
Require all granted
</Directory>

3. Edit Line 62 and 63, change ports to 8080 (default is 80)

Listen 0.0.0.0:8080
Listen [::0]:8080

4.  Now goto C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf and edit/copy the following code. Make this file minimal as possible to avoid errors. Remove log files and other dummy email address.

<VirtualHost *:8080>
DocumentRoot “D:/Projects/website”
ServerName localsite
ServerAlias www.localsite
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot “C:/wamp/www”
ServerName localhost
</VirtualHost>

5. Now start WAMP. You can do it from command prompt

net start wampapache

6. Access the site localsite:8080 (do NOT forget the port)

7. Make sure you have made an entry in Windows host file (location: C:\Windows\System32\drivers\etc\host) as such

127.0.0.1       localhost
127.0.0.1         localsite

If you get any error, reply in the comment below