从squeeze升级到wheezy后,当我在我的服务器上打开一个网页时,我在我的apache错误日志中收到了大量这些消息,(更改为myserver.de
here):
[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,直到这个问题得到解决并且警告消失(如预期的那样)
此外,作为一种解决方法
modsec_audit.log
,我创建了一个 cronjob,它每小时都会删除一个巨大的任务: