↑ ↓ select, Enter open, Esc close

Restart Apache gracefully without dropping connections

Caution: This command changes the system. Understand what it does before you run it.

root@server
apache2ctl graceful

Tells the Apache parent process to reread its configuration and replace child processes only after they finish their current request. Visitors notice nothing, unlike with a hard restart. apache2ctl checks the syntax first and aborts on errors.

Note: After changes to loaded modules or the MPM, a graceful restart is not always enough. In that case systemctl restart apache2 is required.

Also searched as

  • apache graceful restart
  • restart apache without downtime
  • reload apache without dropping connections

Related one-liners

All in Apache

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.