Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OS X custom Apache launch daemon (/Library/LaunchDaemons/).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.company.launchd.apache2</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/apache2/bin/apachectl</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
#!/bin/sh
# unloading current apache (system)
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
sudo chown root:wheel /Library/LaunchDaemons/com.company.launchd.apache2.plist
# loading our custom apache
sudo launchctl load -w /Library/LaunchDaemons/com.company.launchd.apache2.plist
@LucasArruda

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment