diff --git a/dist/init/mac-launchd/README.md b/dist/init/mac-launchd/README.md new file mode 100644 index 00000000..16835677 --- /dev/null +++ b/dist/init/mac-launchd/README.md @@ -0,0 +1,12 @@ +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 diff --git a/dist/init/mac-launchd/com.caddyserver.web.plist b/dist/init/mac-launchd/com.caddyserver.web.plist new file mode 100644 index 00000000..ac20be90 --- /dev/null +++ b/dist/init/mac-launchd/com.caddyserver.web.plist @@ -0,0 +1,31 @@ + + + + + Label + com.caddyserver.web + EnvironmentVariables + + HOME + /Users/mathias + + ProgramArguments + + sh + -c + ulimit -n 8192; cd /Users/mathias/Sites; ./caddy -agree -email my_email@domain.com -conf=/Users/mathias/Sites/Caddyfile + + UserName + www + RunAtLoad + + KeepAlive + + WorkingDirectory + /Users/mathias/Sites + StandardOutPath + /Users/mathias/Sites/caddy.log + StandardErrorPath + /Users/mathias/Sites/caddy_error.log + + \ No newline at end of file