Restarting Apache Web Server from the command line macOS or Linux
To restart, start or stop Apache web server from the command line interface using either Linux or macOS, use the commands below, these commands should be executed as the root user otherwise prefix them with ‘sudo‘
Start Apache
apachectl start
Stop Apache
apachectl stop
Graceful Stop
apachectl graceful-stop
Restart Apache
apachectl restart
Graceful restart
apachectl graceful
To find the Apache version
httpd -v
The use of ‘graceful’ in stopping and restarting allows a less abrupt halt to proceedings allowing any existing webserving to complete before the process is terminated.