Starting Up / Shutting Down Apache

Discussion in 'Mac Basics and Help' started by moonchilddave, Nov 17, 2010.

  1. moonchilddave macrumors regular

    Sep 21, 2009
    I have a MacPro running 10.6.5 (client) on which I've compiled my own Apache 2, PHP, and mySQL.

    What I can't seem to find is how to best control Apache. My requirements are:

    1) I need Apache to start up when the system boots
    2) In order to start Apache, I have a script that automatically enters the pass phrase in order to start SSL.

    What I tried, partially worked:

    I edited /System/Library/LaunchDaemons/org.apache.httpd.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
    <plist version="1.0">
    My apachessl script:
    set apachectl "/usr/local/apache2/bin/apachectl"
    set passphrase [lindex $argv 0]
    spawn $apachectl start
    expect "Enter pass phrase:"
    send "$passphrase\n"
    expect eof
    This gets it up and running at boot as I would expect, however issuing the "/usr/local/apache2/bin/apachectl stop" does not stop the server. Any ideas? What it appears to do is stop 1 instance of the server (seeming to leave behind all the children).
  2. mulo macrumors 68020


    Aug 22, 2010
    Behind you
    rather then all that mess you made, why not just use the apache server that ships with os x?
    simply enable/disable in sharing system preffs.
    oh and you dont need to install ssl, php mysql and what not, its already there.

    also this thread should be located at
  3. moonchilddave thread starter macrumors regular

    Sep 21, 2009
    I roll my own because when security issues crop up, I like to be able to remediate the system immediately rather than waiting on Apple (I have seen them take over a year to fix some things). For PHP, I require Oracle/OCI support compiled in along with a few other extensions not available in the Apple supplied version.

    My apologies for posting in the wrong place - I thought this was more appropriate since it pertains to OS X client (not server).

Share This Page