Sometimes when changing settings in your Apache config, adding virtual hosts and so on it’s needed to reload/restart the Apache daemon. Usually this is done with:
/etc/init.d/apache2 restart
But there two big disadvantages using this method:
- If your config is invalid, Apache will shutdown and not start again
- Users currently accessing your server will recognize that Apache will not answer request for a short time
Indeed there is a much more better method to restart the Apache “gracefully”:
apache2ctl -t Syntax OK
apache2ctl -k graceful
The first command will tell Apache to check your config. If everything is correct, you will get “Syntax OK”, otherwise the error will be reported but Apache will still run with the old configuration.
The second command will tell Apache to restart gracefully with the advantage that currently open connections are not aborted and the users will not be annoyed.
Tags:apache, Graceful, restart
you can also grab the RSS feed or Subscribe to Techgurulive by Email
































