I built my own version of Apache on my mac. I wanted my Mac to use this after I disabled the default Apache that comes with OSX. To do this I needed to create a SystemStarter entry. This was a fairly straight forward process. The end result was Apache persisting across machine reboots.
References
- http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html
- http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/StartupItems.html
- http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/LaunchOnDemandDaemons.html
Creating a system starter entry
1. Create a folder in /Library/StartupItems.
|
|
sudo mkdir /Library/StartupItems/OisinApache
|
2. Create an executable script with the same name as the folder.
1 |
sudo vi /Library/StartupItems/OisinApache/OisinApache
|
3.Create a StartupParamets.plist in the same place as the executable script.
1 |
sudo vi /Library/StartupItems/OisinApache/StartupParamets.plist
|
4. Done! If you followed the above you can now use the following command line to start, stop or restart apache.
|
|
sudo SystemStarter {start | stop | restart} OisinApache
|