I am on Windows 8 and just now installed Wamp 2.5 (Apache 2.4.9) at
C:/wamp to test my code locally. I have my source code repository at
D:/workpace/project1 which I manage using GIT (GIT is one of the reasons I don’t want to disturb its location).
After Installing Wamp, I just went on to enable virtual hosts by uncommenting the following line in
Then I headed to
conf/extra/httpd-vhosts.conf created its backup and created the virtual host.
<VirtualHost *:80> ServerAdmin email@example.com DocumentRoot "D:/workspace/project1/" ServerName project1 ServerAlias p1 ErrorLog "logs/project1(local)-error.log" CustomLog "logs/project1(local)-access.log" common <Directory "D:/workspace/project1/"> Require all granted </Directory> </VirtualHost>
Also edited the hosts file and added the necessary lines.
127.0.0.1 project1 127.0.0.1 p1
The problem is that I get
403 Forbidden error not just when I access
p1/, but also when I access
When I disable httpd-vhosts.conf in httpd.conf by commenting out,
I am able to access
localhost/ but as expected,
p1/ too resolve to
Surprisingly, when I re-enable
httpd.conf and restore the backup of original(unchanged)
httpd-vhosts.conf, I still get
403 (Forbidden) even on
localhost/. But again when I disable
localhost/ comes to normal.
It is furthermore surprising to note that If I change
DocumentRoot to a dummy folder within
c:/wamp/www, the story is the same. So this is not just happening when
DocumentRoot is outside
I feel that I have something extra to enable because there is no chance I have messed up anything as this is a fresh installation and I have made no changes except the ones above.
What may be the reason Apache is not getting along with virtual hosts?