Mac OS X: Restart / Stop / Start Apache2

by on July 16, 2009 · 0 comments· LAST UPDATED July 16, 2010

in

How do I restart Apache 2 web server under Apple Mac OS X UNIX operating systems?

You need to use the apachectl command which nothing but a front end to the Apache 2 (HTTP) server. It is designed to help the administrator control the functioning of the Apache httpd daemon.

Open a terminal and use the following commands.

Task: Restart Apache2 Under Mac OS X

sudo apachectl -k restart

Sample session:

Fig.01: Restarting Apache 2 under Mac Os X Using command line

Fig.01: Restarting Apache 2 under Mac Os X Using command line options


The second command netstat -at | grep LISTEN verifies that port 80 (HTTP) is open and working fine.

Task: Stop Apache2 Under Mac OS X

sudo apachectl -k stop

Task: Start Apache2 Under Mac OS X

sudo apachectl -k start
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , , , , , , , , , , , ,

Previous Faq:

Next Faq: