Mac OS X: Restart / Stop / Start Apache2
On Mac OS X, you can use the following commands to restart, stop, and start Apache2:
- Restart Apache2:
sudo apachectl restart - Stop Apache2:
sudo apachectl stop - Start Apache2:
sudo apachectl start
Note that on newer versions of macOS (such as macOS Catalina and later), Apache2 is no longer included by default, and has been replaced by the built-in Apache web server, which is managed by the httpd command. To restart, stop, or start the built-in Apache web server, you can use the following commands:
- Restart Apache:
sudo apachectl graceful - Stop Apache:
sudo apachectl stop - Start Apache:
sudo apachectl start
