How to restart Apache service
There are many ways to restart Apache
service and this depends on your platform of choice and personal preferences
Platform | Command |
---|---|
Ubuntu 16.10 and later, RedHat/CentOS 7 and later, Fedora and other platform with systemd |
# systemctl restart httpd.service |
Platforms with service command. Normally a wrapper to System V init scripts or systemd commands. |
# service httpd restart |
Older platforms with System V init scripts |
# /etc/init.d/apache2 restart |
Apache’s built-in command |
# httpd -k restart |
Different platform might use different binary/script names such as apache
, apache2
, apachectl
or apache2ctl