Monday, April 18, 2005

Restart Apache

If you need to restart Apache to have it re-read the httpd.conf configuration file then type this in the consile:
kill -HUP `cat /usr/local/apache2/logs/httpd.pid`

Explination:
HUP Signal: restart now

Sending the HUP signal to the parent causes it to kill off its children like in TERM but the parent doesn't exit. It re-reads its configuration files, and re-opens any log files. Then it spawns a new set of children and continues serving hits.

Users of the status module will notice that the server statistics are set to zero when a HUP is sent.

Note: If your configuration file has errors in it when you issue a restart then your parent will not restart, it will exit with an error. See below for a method of avoiding this.


...taken from Stopping and Restarting Apache

No comments: