Thursday, April 12, 2007

Reload httpd.conf in Apache http server

Before reloading the httpd.conf file, you'd better use "apachectl configtest" to check if the conf file is valid.
According to "man apachectl":
apachectl restart - Restarts the Apache daemon by sending it a SIGHUP. If the daemon is not running, it is started. This command automatically checks the configuration files via configtest before initiating the restart to make sure Apache doesn't die.
apachectl graceful - Gracefully restarts the Apache daemon by sending it a SIGUSR1. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted. A side effect is that old log files will not be closed immediately. This means that if used in a log rotation script, a substantial delay may be necessary to ensure that the old log files are closed before processing them. This command automatically checks the configuration files via configtest before initiating the restart to make sure Apache doesn't die.
The 'graceful' would only be required if you are updating an active in-service machine and you do not want to interupt active connections.

No comments: