Apache 403 error except from localhost

a 夏天 提交于 2019-12-13 02:53:41

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!