Chinaunix首页 | 论坛 | 博客
  • 博客访问: 92138572
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: LINUX

2008-04-16 22:32:52

作者: Buyto  出自:
Fedora 7以上为了加强Apache2.0的安全性,系统安装时会默认安装Mod_Security模组增加安全,不过由于此模组限制的安全性偏高,因此会出现以下几种状况﹕

使用真实IP连结时,会出现HTTP Error 400的讯息,讯息如下:

Bad Request
Your browser sent a request that this server could not understand.
Apache/2.2.0 (Fedora) Server at 127.0.0.1 Port 80

程式如果有使用Ajax撰写者,会容易连线失败。

解决方法:

编辑文件/etc/httpd/modsecurity.d/modsecurity_crs_21_protocol_anomalies.conf

SecRule REQUEST_HEADERS:Host "^[\d\.]+$" "deny,log,auditlog,status:400,msg:'Host header is a numeric IP address', severity:'2',id:'960017'
改为
#SecRule REQUEST_HEADERS:Host "^[\d\.]+$" "deny,log,auditlog,status:400,msg:'Host header is a numeric IP address', severity:'2',id:'960017'

移除Mod_Security套件,虽然不太建议不过这也是一个解决方案。

yum remove -y mod_security
阅读(255) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~