从 squeeze 升级到 wheezy 之后,当我在我的服务器上打开网页时,我会在 apache 错误日志中收到大量此类消息(更改为myserver.de
此处):
[Sat Oct 19 01:06:21 2013] [error] [client 213.239.220.106] ModSecurity: Warning. Match of "rx ^OPTIONS$" against "REQUEST_METHOD" required. [file "/etc/apache2/modsecurity2/modsecurity_crs_21_protocol_anomalies.conf"] [line "41"] [id "960015"] [msg "Request Missing an Accept Header"] [severity "CRITICAL"] [tag "PROTOCOL_VIOLATION/MISSING_HEADER"] [hostname "www.myserver.de"] [uri "/js/jquery-ui-1.8.14.custom_myserver/css/custom-theme/images/ui-icons_ff7519_256x240.png"] [unique_id "UmG@7X8AAQEAAHHDMOkAAAAB"]
[Sat Oct 19 01:06:21 2013] [error] [client 213.239.220.106] ModSecurity: Warning. Match of "rx ^OPTIONS$" against "REQUEST_METHOD" required. [file "/etc/apache2/modsecurity2/modsecurity_crs_21_protocol_anomalies.conf"] [line "41"] [id "960015"] [msg "Request Missing an Accept Header"] [severity "CRITICAL"] [tag "PROTOCOL_VIOLATION/MISSING_HEADER"] [hostname "www.myserver.de"] [uri "/js/jquery-ui-1.8.14.custom_myserver/css/custom-theme/images/ui-bg_highlight-soft_20_372806_1x100.png"] [unique_id "UmG@7X8AAQEAADSz0KYAAAAC"]
[Sat Oct 19 01:06:21 2013] [error] [client 213.239.220.106] ModSecurity: Warning. Match of "rx ^OPTIONS$" against "REQUEST_METHOD" required. [file "/etc/apache2/modsecurity2/modsecurity_crs_21_protocol_anomalies.conf"] [line "41"] [id "960015"] [msg "Request Missing an Accept Header"] [severity "CRITICAL"] [tag "PROTOCOL_VIOLATION/MISSING_HEADER"] [hostname "www.myserver.de"] [uri "/js/jquery-ui-1.8.14.custom_myserver/css/custom-theme/images/ui-bg_flat_75_ddd4b0_40x100.png"] [unique_id "UmG@7X8AAQEAADTD27sAAAAF"]
第 40 行和第 41 行
/etc/apache2/modsecurity2/modsecurity_crs_21_protocol_anomalies.conf`:
看起来像这样:
SecRule &REQUEST_HEADERS:Accept "@eq 0" \
"chain,phase:2,skip:1,t:none,log,auditlog,msg:'Request Missing an Accept Header', severity:'2',id:'960015',tag:'PROTOCOL_VIOLATION/MISSING_HEADER'"
这会与 mod_pagespeed 冲突吗?
更新:我禁用了 mod_security,直到这个问题解决并且警告消失(如预期的那样)
答案1
此外,作为解决方法我创建了一个 cronjob,modsec_audit.log
每小时删除大量的数据:
# empty mad modsec log
16 * * * * echo "">/var/log/apache2/modsec_audit.log