403 error in accessing localhost after wamp installation, despite having "Allow from 127.0.0.1" in apache conf

2.2k Views Asked by At

I've just installed Wamp and I'm getting 403 access denied error when I try to access http://localhost.
I've checked my apache configuration file and it has the line Allow from 127.0.0.1 in both <Directory /> and <Directory "c:/wamp/www/"> sections.
So why the access to root directory is forbidden for localhost?!

1

There are 1 best solutions below

0
On BEST ANSWER

Depending on the OS, Apache may be binding to IPv6 address, so the localhost is recognizing as ::1 instead of 127.0.0.1.
You have to add Allow from ::1 instead of Allow from 127.0.0.1 in apache config file.
NOTE: Problem can be solved also if you add Allow from all to root directory section in http config file, but it's not a good idea because this way your web root became accessible from any computer in the network you are.