Restart Apache service

There are many ways to restart Apache service and this depends on your platform of choice and personal preferences

Command Method and Applicable Platform
# systemctl restart httpd.service
Systemd. Ubuntu 16.10 and later, RedHat/CentOS 7 and later, Fedora and other platform with systemd
# service httpd restart
Platforms with service command. Normally a wrapper to System V init scripts or systemd commands.
# /etc/init.d/apache2 restart
Older platforms with System V init scripts
# httpd -k restart
Apache's built-in command

Different platform might use different binary/script names such as apache, apache2, apachectl or apache2ctl

Sign up for Complete Apache HTTP Server Course and many other great courses on Udemy to learn more.

Complete Apache HTTP Server Course

Master Apache 2.4 web server and start on-demand career!

Written by Mohd Shakir Zakaria. Last updated on 2019-02-12