0

When configuring Apache, some configuration options can be safely applied via a reload. Others require a full restart of the Apache process.

I have been unable to figure out which are which while reading the Apache docs. Nor have I found anything when searching the web.

So, which directives can be updated via a reload?

Which directives can only be updated via a restart?

See the directive quick reference for a list of all the directives.

Thanks for your help!

Edit: https://httpd.apache.org/docs/2.4/stopping.html doesn't list a reload. And I saw that the httpd.service file on CentOS 7 uses -k graceful for the reload command. Does that mean that a 'reload' on any OS is actually a graceful restart? Which would mean I could rely on a 'reload' to apply all my configuration changes safely.

  • A "reload" kills all children and rereads the configuration, so there should effectively be no difference. – Ignacio Vazquez-Abrams May 25 '18 at 23:33
  • Does that apply to all OS's? I know it does to CentOS 7 as I noted in my edit. – David R. May 25 '18 at 23:55
0

graceful will replace all children with a new ones running the new configuration. The parent does not exit. It can be used for all configuration file changes, but not an upgrade to the httpd binary.

If you are concerned with the availability of a web server, put multiple of them behind a load balancer. Then you can do rolling restarts, and it will not matter if you use graceful or graceful-stop. AKA systemctl reload or restart.

reload is a systemd command that is not named the same on all operating systems. Others use the kill signals in their own, platform specific, init scripts. Remember that httpd is portable runs on many things: UNIX (AIX, HP-UX, Solaris), not-UNIX (Linux), BSD, Windows, IBM i, z/OS.

  • Thanks. Your explanation about reload was what I needed. :) I was mistakenly assuming that reload was part of apache. – David R. May 31 '18 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.