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

Watch online courses:
Leave a comment:
Share!