How to `Graceful Restart Apache` in centos 7?

kittygirl asked:

My system is centos 7.4, with apache 2.4
Based on apache manual,apachectl -k graceful should be the way to graceful restart apache, but I got notice as below:

[[email protected] root]# apachectl -k graceful
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.

What’s the problem?
How to Graceful Restart Apache in centos 7?

My answer:


As with other Linux distributions that use systemd, you can manage httpd with systemctl. In particular:

systemctl reload httpd

will cause httpd to reload its configuration files and restart its workers with the new configuration, exactly as graceful did.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.