Skip to content
Latchkey

apachectl graceful: Reload Apache Safely

apachectl graceful re-reads the config and replaces workers as they finish current requests, without dropping live connections.

graceful is the deploy-safe reload for Apache. Crucially, if the new config fails to parse, graceful keeps the old config running instead of taking the server down.

What it does

apachectl graceful sends SIGUSR1 to the parent httpd process. Children finish their current request, then reload the configuration and log files. If the new configuration has a syntax error, the graceful reload is aborted and the server continues running the previous config. graceful-stop shuts down gracefully; restart is a hard restart that drops connections.

Common usage

Terminal
# test then gracefully reload
apachectl configtest && apachectl graceful
# other controls
apachectl restart         # hard restart, drops connections
apachectl graceful-stop   # graceful shutdown
apachectl stop            # immediate stop

Options

CommandWhat it does
gracefulReload config without dropping connections (SIGUSR1)
graceful-stopShut down after current requests finish
restartHard restart, drops connections (SIGHUP)
stopImmediate shutdown
startStart the server

In CI

Always run apachectl configtest before graceful in a deploy step. graceful is self-protecting (a bad config is refused and the old one keeps serving), but running configtest first gives you a clear failing exit code in the pipeline instead of a silent no-op reload.

Common errors in CI

httpd (pid 1234?) not running means there is no parent process to signal; start Apache first. If graceful appears to succeed but changes do not apply, the new config failed to parse and Apache kept the old one; run configtest to see the syntax error. "could not bind to address 0.0.0.0:80" on restart means the port is already in use.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →