从2.2.7升级到Apache 2.4.9后,似乎日志logging无法正常工作。 只有logging的东西是modsecurity和fcgid事件,但没有像Apache文件没有发现错误。 检查Apache的error_log,特别是重新启动后,我已经注意到这一点:
[Sun Jul 13 05:16:10.482003 2014] [log_config:warn] [pid 30283:tid 140001085970176] (32)Broken pipe: [client 125.166.227.47:26260] AH00646: Error writing to |/usr/local/cpanel/bin/splitlogs --main=server.mysite.com --suffix=-bytes_log [Sun Jul 13 05:16:10.482047 2014] [log_config:warn] [pid 30283:tid 140001085970176] (32)Broken pipe: [client 125.166.227.47:26260] AH00646: Error writing to |/usr/local/cpanel/bin/splitlogs --main=server.mysite.com --mainout=/usr/local/apache/logs/access_log
我不知道“破pipe”是什么意思。 我启用了pipe道日志logging(在升级Apache之前已启用)。 试图禁用它,但得到了同样的事情,没有logging。 在日志部分检查httpd.conf文件与旧的conf文件比较,但似乎无法find任何不同:
<IfModule mod_log_config.c> LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedvhost LogFormat "%v %{%s}t %I .\n%v %{%s}t %O ." bytesvhost LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog "|/usr/local/cpanel/bin/splitlogs --main=server.mysite.com --suffix=-bytes_log" bytesvhost CustomLog "|/usr/local/cpanel/bin/splitlogs --main=server.mysite.com --mainout=/usr/local/apache/logs/access_log" combinedvhost </IfModule>
如果有人能够说明这一点,我将不胜感激。 谢谢。
更新:通过将access_log和error_log的权限更改为777,已经消除了损坏的文件错误。 主要的问题仍然存在,虽然没有任何Apache相关的错误(404,403等)正在logging。
好吧,我想我已经明白了这一点! 而解决方法是在httpd.conf中更改以下指令:
LogLevel warn
新的价值:
LogLevel info
显然,Apache 2.4.9中一些错误日志的意义已经改变了,所以像404这样的错误日志现在处于信息级别,如下所述: http : //httpd.apache.org/docs/current/mod/core.html#loglevel