问题
When i try to connect to my WAMP server using anything but localhost i get error 403.
[Tue Sep 24 10:23:06.363000 2013] [access_compat:error] [pid 2912:tid 1520] [client ip:ip:ip:ip:49886] AH01797: client denied by server configuration: C:/wamp/www/
[Tue Sep 24 10:23:06.916000 2013] [access_compat:error] [pid 2912:tid 1520] [client ip:ip:ip:ip:49886] AH01797: client denied by server configuration: C:/wamp/www/favicon.ico
I tried to start the wamp services as my account (running on win7 x64). I tried to edit these lines in the httpd.config
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
but i still get the error. EDIT: I installed an older version of WAMP (2.2E) and everything works fine not sure what's different in the newest version (2.4)
回答1:
Change that section back to
Order Deny,Allow
Deny from all
That section controls access to your root drive and that should always be `Deny from all'
Look for this section of https.conf
# onlineoffline tag - don't remove
And change the section below that to
Allow from 127.0.0.1 ::1 localhost
Also make sure that your hosts file c:\windows\system32\drivers\etc\host
has these entries
127.0.0.1 localhost
::1 localhost
EDIT:
You didn't actually say you were using WAMP 2.4. It would have helped:
In that case, read this thread, from the wampserver forum, it describes how to fix a bunch of 2.4 issues.
来源:https://stackoverflow.com/questions/18975560/apache-403-error-except-from-localhost