Debian – apache restarted/reloaded config by itself automatically, why

apache-2.2crondebianlogrotate

in short:

  • running production webserver
  • tuesday: changed config (the change was erroneous, wrong syntax) but deliberately not restarted apache
  • apache restarted or reloaded config by itself today @cron.daily time
  • apache was down

why apache restarted or reloaded config by itself?

long version

on my debian lenny stable server, which has a quite default setup (apache2, mod_php, mysql client, apc,…) i made a change to my apc.ini where i was not sure if it is faulty or not, because it is an production server, i just safed the file without restarting the webserver.

today @cron.daily time (6:25), the server restarted itself and stayed down because of the faulty apc.ini. i really want to know, why the server restarted itself. also why today? it is the cron.daily time and not the weekly time, the faulty config is online since tuesday.

crontab:

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

cron.daily content:

apache2
apt
aptitude
bsdmainutils
logrotate
man-db
standard

cron.weekly content:

man-db

any ideas?

edit:
added logrotate tag based on the selected answer

Best Answer

cron run logrotate, logrotate reload Apache:

/var/log/apache2/*.log {
        ........
        postrotate
                if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
                        /etc/init.d/apache2 reload > /dev/null
                fi
        endscript
}
Related Topic