You can restart Apache 2 in Mac OS X using the Terminal. Here’s how:
- Open the Terminal application. You can find it in the Utilities folder within the Applications folder.
- Type the following command to stop Apache 2:
sudo apachectl stop
You will be prompted for your password. Enter your password to continue.
- Type the following command to start Apache 2:
sudo apachectl start
That’s it! Apache 2 should now be restarted and running.
Note that in some versions of Mac OS X, the Apache 2 service may be set to automatically start when your computer starts up. If this is the case, you can use the following command to restart Apache 2 without having to stop it first:
sudo apachectl restart