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

StackOverflow https://stackoverflow.com/questions/18232003

سؤال

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?!

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top