A
A
Artem2013-05-12 23:20:10
Apache HTTP Server
Artem, 2013-05-12 23:20:10

Apache crashes after log rotation

There is a server on FreeBSD 8.0 with Apache 2.2.23, PHP 5.4.10 and nginx 1.2.6. Accordingly, nginx comes first, followed by Apache. The problem is that Apache crashes steadily every few days after the logs are rotated. Log rotation is performed using logrotate with a config like this:

"/usr/home/mysite/logs/*.log" "/var/log/*-error.log" "/var/log/*-access.log" {
    su root www
        daily
        rotate 7
        compress
        ifempty
        missingok
        nomail
    prerotate
    /usr/local/www/awstats/tools/awstats_updateall.pl now -awstatsprog=/usr/local/www/awstats/cgi-bin/awstats.pl
    endscript
        postrotate
    /usr/bin/killall -HUP httpd
        endscript
        sharedscripts
}


After rotation in the old error.log:
[Mon May 13 00:01:03 2013] [notice] SIGHUP received.  Attempting to restart


In the new one:
[Mon May 13 00:01:03 2013] [notice] Digest: generating secret for digest authentication ...
[Mon May 13 00:01:03 2013] [notice] Digest: done
[Mon May 13 00:01:05 2013] [notice] Apache/2.2.23 (FreeBSD) PHP/5.4.10 configured -- resuming normal operations
[Mon May 13 00:01:06 2013] [notice] child pid 88614 exit signal Segmentation fault (11), possible coredump in /usr/local
[Mon May 13 00:01:06 2013] [notice] child pid 88613 exit signal Segmentation fault (11), possible coredump in /usr/local
[Mon May 13 00:01:06 2013] [notice] child pid 88612 exit signal Segmentation fault (11), possible coredump in /usr/local
...
[Mon May 13 00:02:48 2013] [notice] child pid 88818 exit signal Segmentation fault (11), possible coredump in /usr/local
[Mon May 13 00:02:49 2013] [notice] child pid 88884 exit signal Segmentation fault (11), possible coredump in /usr/local
[Mon May 13 00:02:49 2013] [notice] child pid 88883 exit signal Segmentation fault (11), possible coredump in /usr/local
[Mon May 13 00:02:50 2013] [notice] caught SIGTERM, shutting down


In /usr/local/ the httpd.core file is created, weighing about 16 megabytes.

If after that you just start Apache, it starts wildly eating RAM and CPU. If you restart the entire server, everything works fine.

How can this be fixed? Where to dig?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question