I found that reload option is better than restart httpd service. systemctl restart httpd

Answer from Savana Rohit on Stack Overflow
Top answer
1 of 3
9

Please see this page on apachectl, which appears to be a new version: https://httpd.apache.org/docs/2.4/programs/apachectl.html

There is no need to pass the '-k' argument. apachectl graceful (without the -k) works just fine for a graceful reload/restart on my Centos7 box and Centos6 box.

Apparently nobody updated the manual page OP cited in her question, which still exists, and where the commands are shown with the '-k' argument throughout (apachectl -k graceful, apachectl -k restart, etc.) There's no explanation on that page about what the -k argument is actually doing, however.

But on the newer page there is this note on about apachectl graceful:

This is equivalent to apachectl -k graceful.

On my Centos6 box, I had been using the command service httpd graceful. That no longer worked on Centos7. It's necessary to use apachectl graceful to do the equivalent on Centos 7. Also apachectl graceful works just fine on Centos 6.

2 of 3
5

Most systemd-based distributions use a patched apachectl script [1] that delegates commands to systemctl. The patched apachectl command does not support the "pass-through" mode of operation in which arguments are passed through to httpd. The apachectl manual page reflects the upstream non-patched apachectl command, hence the discrepancy.

I recommend using the systemctl [2] abstraction for starting and stopping services.

Thus, to gracefully restart the Apache HTTP Server on Centos 7, and other linux distributions using systemd, use:

sudo systemctl reload httpd.service

Under the hood, this invokes httpd -k graceful. You can verify this with this command:

$ systemctl cat httpd.service | grep -F ExecReload
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful

To stop the Apache HTTP Server:

sudo systemctl stop httpd.service

which, behind the scenes, sends a SIGWINCH signal to the httpd process.

This can be verified with this command:

$ systemctl cat httpd.service \
  | grep -E --before-context=1 'ExecStop|KillSignal'
# Send SIGWINCH for graceful stop
KillSignal=SIGWINCH

The systemd.service [3] manual says that in this situation, where the ExecStop option is not specified, "the process is terminated by sending the signal specified in KillSignal."

Why SIGWINCH? Because, per https://bz.apache.org/bugzilla/show_bug.cgi?id=50669 , Apache uses the SIGWINCH signal as a 'graceful shutdown' trigger.

Another command you may find useful to explore service options is the show command combined with -p, --property options, like this:

$ systemctl show httpd.service -p ExecStart -p ExecReload -p ExecStop -p KillSignal

[1] https://git.centos.org/blob/rpms!httpd.git/c7/SOURCES!httpd-2.4.3-apctl-systemd.patch
[2] https://www.freedesktop.org/software/systemd/man/systemctl.html
[3] https://www.freedesktop.org/software/systemd/man/systemd.service.html

🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to restart apache on centos and rocky linux
How to Restart Apache on CentOS and Rocky Linux
December 17, 2025 - There are two main ways to restart Apache on CentOS or Rocky Linux: using the systemctl command or the apachectl command.
🌐
nixCraft
cyberciti.biz › nixcraft › howto › apache › starting, stopping, and restarting apache 2 webserver command
Start / Stop and Restart Apache 2 Web Server Command - nixCraft
October 7, 2024 - ... Bonjour, en utilisant la commande suivante : service httpd restart j’obtient le resultat suivant : Redirecting to /bin/systemctl start httpd.service Job for httpd.service failed.
🌐
nixCraft
cyberciti.biz › nixcraft › howto › apache › restart httpd server command
Restart Httpd Server Command - nixCraft
October 16, 2022 - Login as the root user and type the following commands on RHEL/CentOS version 5.x/6.x or older version. For example: # service httpd start ... The command is: # service httpd stop Please note that restart option is a shorthand way of stopping and then starting the Apache HTTPd Server.
🌐
IONOS
ionos.com › digital guide › server › configuration › restart apache
How and when to restart Apache
October 27, 2023 - Apache is a widely used web server. In this article, we’ll explain how you can successfully restart Apache.
Find elsewhere
🌐
Hoststud
hoststud.com › home › resources › operating sytems › linux
How to Start/Stop or Restart Apache server on CENTOS Linux server ? | Web Hosting Forum - Review - Community & Resources
June 15, 2017 - To start your Apache server for Linux version 4.x/5.x/6.x or older commands : ## Start ## ... Click to expand... ## Stop ## ... Click to expand... ## Restart ##
🌐
Plesk
support.plesk.com › hc › en-us › articles › 12377658614679-How-to-restart-Apache-service-in-Plesk-for-Linux
How to restart Apache service in Plesk for Linux – Plesk
January 13, 2026 - Depending on the operating system installed on the server, execute the command to restart Apache: On CentOS, RHEL, CloudLinux: # service httpd restart · On Debian or Ubuntu: # service apache2 restart · apa.png · (20 KB) 0 comments · Please ...
🌐
Quora
quora.com › How-do-you-start-stop-and-restart-Apache-on-CentOS-RHEL
How to start, stop, and restart Apache on CentOS/RHEL - Quora
Answer (1 of 4): Method 1: Restart Apache Server Using Systemctl Command Open a terminal window and enter the following: * sudo systemctl restart httpd.service The service should restart. Method 2: Restart HTTPD Server Using Apachectl Command Script Apache recommends using a control script t...
🌐
Namehero
namehero.com › blog › how-to-restart-apache-on-linux
How To Restart Apache On Linux
November 6, 2024 - You can restart Apache on Linux either gracefully, or via a hard reset. Here's how to do both, and the why it might be necessary.
🌐
GoDaddy
godaddy.com › home › how to restart apache without rebooting your centos linux server
How to restart Apache without rebooting your CentOS Linux server - GoDaddy Resources - India
February 15, 2024 - Although there are at least a half-dozen different ways to restart httpd, I suggest using the service command. The main benefit when it comes to a CentOS server: service will continue to work for you if you migrate to a more specialized http server such as nginx. Interestingly, the Apache httpd documentation uses the apachectl command.
🌐
Wsldp
elearning.wsldp.com › pcmagazine › restart-apache-on-centos-7
How to Restart Apache on CentOS 7 - e Learning
Two Commands can be used to Restart Apache HTTPD Server on CentOS 7 Linux. Those Two Commands are systemctl command and apachectl command.
🌐
Webbege
info.webbege.com › blog › how-to-restart-apache-using-linux
How to Start/Stop Apache Using Centos Linux
October 31, 2017 - Let's set the scene: Maybe you reconfigured your virtual hosts, or maybe you have a memory leak that is killing resources and you need to restart the server. Instead of rebooting the VM, you can simply restart Apache!