Stop/Start Apache?

Jump to First Reply
Posted:
in Genius Bar edited January 2014
I'm looking for a quick way to stop or start Apache, without going into Preferences.



Is it possible via AppleScript or something?



Thanks in advance,



unry

Comments

  • Reply 1 of 3
    willoughbywilloughby Posts: 1,457member
    You can stop, start and restart apache from the command line with these commands:



    apachectl -k start



    apachectl -k stop



    apachectl -k graceful



    The last one is the best way to quickly stop and restart apache. I'm sure you could write an applescript to send those to the command line.
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 3
    Thanks. I tried sending those to the terminal with QuicKeys, but it doesn't work...is it because I've installed Apache 2?
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 3
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    Honestly, what is hard or time consuming about opening System Preferences? That is probably the easiest way to start/stop Apache that I've yet seen.



    Write a bash script (type text into a plain text document with Textedit and then 'chmod +x' it to make it executable) and simply execute that whenever you want Apache to start stop.
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.