Skip to content

Instantly share code, notes, and snippets.

@timsnadden
Last active December 27, 2015 18:09
Show Gist options
  • Save timsnadden/7367532 to your computer and use it in GitHub Desktop.
Save timsnadden/7367532 to your computer and use it in GitHub Desktop.
Monitor modifications to apache config on mac and restart server. Place in /Library/LaunchAgents/
<?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>Label</key>
<string>com.snadden.apacheConfMonitor</string>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/apachectl</string>
<string>restart</string>
</array>
<key>WatchPaths</key>
<array>
<string>/private/etc/apache2</string>
</array>
</dict>
</plist>
@timsnadden
Copy link
Author

sudo launchctl load /Library/LaunchAgents/com.snadden.apacheConfMonitor.plist

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