Skip to content

Apache graceful versus restart on cPanel — choosing the right reload for the change

A short reference for which Apache reload command is required for which change on a cPanel server, with the cases where graceful is wrong, the cases where it is right, and the trap of accidentally restarting under change pressure.

apachectl graceful is what most cPanel operators reach for, correctly. There are a handful of cases where it is the wrong call — and a much larger set where it is the only right call. Knowing the difference takes a minute to memorize and saves the conversation that starts “the change went out clean but the customer’s connection dropped.”

What’s happening

apachectl graceful (SIGUSR1) reloads config without killing existing connections — in-flight requests finish on the old workers, new connections use the new config. apachectl restart (SIGHUP) terminates children immediately. apachectl graceful-stop drains existing connections without starting new workers; pair with start for a clean binary upgrade. systemctl restart httpd invokes stop + start and is the most disruptive option.

How to verify

Before any reload, confirm the change scope and what is actually changing:

apachectl -V | grep MPM
apachectl -t
ps -ef | grep -E "httpd|apache" | wc -l
ss -s

The fix

The decision table:

  1. Vhost edit, ModSecurity rule change, Include Editor change → apachectl graceful. Config-only changes pick up cleanly.
  2. Module add or remove via EasyApache 4 → EA4 handles the reload automatically; do not also restart manually.
  3. MPM change (prefork to event) → full restart required. EA4 invokes it as part of the provision.
  4. Apache binary upgrade (EA4 itself) → graceful-stop + start, with a maintenance window. EA4 handles this.
  5. Listen port change → full restart. Sockets cannot be reloaded.
  6. PHP-FPM pool change → not an Apache action; systemctl reload ea-php<ver>-php-fpm. Apache reconnects to the FPM socket on next request.
  7. Logrotate postrotate → apachectl graceful. Apache opens new log file handles.
  8. TLS certificate renewal → graceful. New connections handshake against the new cert.
  9. DDoS in progress, need to apply a block immediately → graceful is still right. Restart drops the in-flight legitimate connections too.
  10. Apache wedged, all workers hung → graceful first; if it does not return in 30 seconds, then systemctl restart httpd. Not before.

Run apachectl -t before any reload. Skipping that step is the single most common cause of “Apache will not come back up.”

For environments where Apache reload discipline is part of change management, Stack Harbor gates every change with config-test and graceful-first under managed cPanel operations.