≡ Menu

Mac OS X Start / Stop Apache Web Server

How do I start or stop Apache web server using shell prompt option under Apple OS X UNIX operating systems?

The apachectl command act as Apache HTTP Server control interface. Open the terminal and type the following command to stop Apache web server:

sudo apachectl stop


sudo apachectl -k stop

To start Apache web server again, enter:

sudo apachectl start


sudo apachectl -k start

The following will restart apache web server, enter:

sudo apachectl restart


sudo apachectl -k restart

You can displays a brief status report by visiting the url http://localhost:80/server-status in the web browser of your choice.

Share this tutorial on:

Like this? Follow us on Twitter OR support us by using Patreon

{ 5 comments… add one }
  • Antony July 14, 2012, 7:26 pm

    For some interesting reason, apache keeps spawning off new process however I kill it. I tried apachectl and kill -SIGTERM but apache would be killed and another process will be spawned right away.
    Can you tell me why?

  • flamencoman July 24, 2012, 10:31 am

    I have the same problem as you Antony.
    I’ve used MAMP and then switched to Mac’s default Apache and problem still exists.
    I think it is somehow related to xdebug. I’ll try zend_debugger. If that doesn’t work, I’m switching to another operating system.

  • Evaristo Coimbra October 10, 2013, 10:53 pm

    in /Applications/XAMPP/xamppfiles/xampp include inicial line sudo apachectl stop

  • Miguel A. Acevedo November 15, 2013, 7:34 pm

    404-not found
    could not be satisfied

  • Vinit April 1, 2016, 9:30 pm

    Use this to stop the apache server
    sudo /usr/sbin/apachectl stop

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , , , , ,