Commit 8c392a02 authored by Matt Holt's avatar Matt Holt Committed by GitHub

Merge pull request #1267 from DenBeke/launchd

launchd service file for Mac
parents b783caaa 30337ac3
launchd service for macOS
=========================
This is a sample file for a *launchd* service on Mac.
Edit the paths and email in the plist file to match your info.
Start and Stop the Caddy launchd service using the following commands:
$ launchctl load ~/Library/LaunchAgents/com.caddyserver.web.plist
$ launchctl unload ~/Library/LaunchAgents/com.caddyserver.web.plist
More information can be found in this blogpost: [Running Caddy as a service on macOS X server](https://denbeke.be/blog/software/running-caddy-as-a-service-on-macos-os-x-server/)
\ No newline at end of file
<?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.caddyserver.web</string>
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>
<string>/Users/mathias</string>
</dict>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>ulimit -n 8192; cd /Users/mathias/Sites; ./caddy -agree -email my_email@domain.com -conf=/Users/mathias/Sites/Caddyfile</string>
</array>
<key>UserName</key>
<string>www</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>WorkingDirectory</key>
<string>/Users/mathias/Sites</string>
<key>StandardOutPath</key>
<string>/Users/mathias/Sites/caddy.log</string>
<key>StandardErrorPath</key>
<string>/Users/mathias/Sites/caddy_error.log</string>
</dict>
</plist>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment