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:
My apachessl script:
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).
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:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>org.apache.httpd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/apache2/bin/apachessl</string>
<string>myserver-password</string>
<string>-D</string>
<string>FOREGROUND</string>
</array>
<key>OnDemand</key>
<false/>
<key>SHAuthorizationRight</key>
<string>system.preferences</string>
</dict>
</plist>
My apachessl script:
Code:
#!/usr/bin/expect
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).