pc77044 的網頁解法

No Comments

http://www.linuxsir.org/bbs/lastpostinthread316510.html

/etc/httpd/conf.d 移除 mod_security 即可解決。

— 以下引原連結, 為免網址失連 —

系统Fedora7,自带的LAMP系统运行正常,用yum升级了apache和几个相关模块后,访问Localhost,出现问题。
症状:
本地访问localhost,403 Forbidden, You don’t have permissions to access / on this server.
远程访问, 400 Bad Request, Your browser send a request this server could not understand.

解决方法:
1
按照第一感觉是permission,查看目录permission,没有问题。
2
google下,有类似问题,原因是SELinux,解决方法为:
chcon -R -t httpd_user_content_t <your_web_root> 试过以后,问题继续。
全部disable SELinux,还是没用。
3
分析 error_log,相关部分如下:
[Sun Nov 11 07:30:06 2007] [error] [client 127.0.0.1] ModSecurity: Access denied with code 403 (phase 4)… …
4
在 /etc/httpd/conf.d 中,找到 mod_security 备份后删除,重启apache,问题解决。
5
分析了mod_security 的内容并查看 http://www.modsecurity.org 没有找到问题原因,只有暂时不用这个mod, 为什么mod_security会造成这个403错误,请大家指教原因。

Leave a Reply

Share via
Copy link