2

After upgrading from 2.2.7 to Apache 2.4.9 seems that logging doesn't work properly. Only things which are logged are modsecurity and fcgid events, but nothing from Apache like file not found errors. Checking the Apache error_log, specifically after a restart I've noticed this:

[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

I haven't got a clue what "broken pipe" means. I have piped logging enabled (which was enabled before upgrading Apache). Tried disabling it but got the same thing and nothing logged. Checked httpd.conf file at the log section comparing with the old conf file but can't seem to find anything different:

<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>

I'd appreciate it if anyone could shed some light on this. Thanks.

UPDATE: Broken file error have been eliminated by changing perms to 777 for access_log and error_log. Main problem still persists though, as in none of Apache related errors (404, 403 etc.) are getting logged.

  • I assume this path exists? '/usr/local/cpanel/bin/splitlogs' Does the user apache is running as have permissions to write there? – user16081-JoeT Jul 13 '14 at 2:41
  • Yes the path exists. How do I check if the permissions are correct? – Ivan Jul 13 '14 at 2:43
  • Alright so here's the file's permissions: -rwxr-xr-x 1 root root 1258640 Mar 10 23:16 /usr/local/cpanel/bin/splitlogs* but Apache is ran by user nobody. Should I change owner for splitlogs? – Ivan Jul 13 '14 at 3:02
  • So I changed perms to 777 for 'splitlogs' but to no avail. I've also changed owner and group to user 'nobody' to be the same as Apache but also to no avail. Any more ideas? – Ivan Jul 13 '14 at 3:20
  • I've also tried with changing perms to 777 for access_log and error_log. This also had no effect either. HELP! – Ivan Jul 13 '14 at 3:33
7

Alright so I think I've figured this out! And the fix was to change in httpd.conf the following directive:

LogLevel warn

new value:

LogLevel info

Apparently some error logs significance has been changed in Apache 2.4.9 so error logs like 404 are at info level now, as documented here: http://httpd.apache.org/docs/current/mod/core.html#loglevel

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.