GUI method:
- Open the Sharing prefPane in System Preferences. The checkbox by "Web Sharing" indicates if Apache is started or stopped.
- To start Apache, check the "Web Sharing" box.
- To stop Apache, uncheck it.
- To restart Apache, uncheck then check it.
Command line method:
- Open Terminal.
- Type the following to start Apache:
sudo apachectl start
- Type the following to stop Apache:
sudo apachectl stop
- Type the following to restart Apache:
sudo apachectl restart
To test the status of Apache, visit http://localhost in your browser. If the page loads, Apache is started; elsewise it is stopped.