From 86854dca89fa945a34c76ac9469b720dc787410a Mon Sep 17 00:00:00 2001 From: MathiasB Date: Thu, 31 Mar 2016 14:36:44 +0200 Subject: [PATCH] dist/init: caddy.conf for upstart --- dist/init/linux-upstart/README.md | 13 +++++++++++++ dist/init/linux-upstart/caddy.conf | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 dist/init/linux-upstart/README.md create mode 100644 dist/init/linux-upstart/caddy.conf diff --git a/dist/init/linux-upstart/README.md b/dist/init/linux-upstart/README.md new file mode 100644 index 00000000..3fd99fda --- /dev/null +++ b/dist/init/linux-upstart/README.md @@ -0,0 +1,13 @@ +Upstart conf for Caddy +===================== + +Usage +----- + +Usage in this blogpost: [Running Caddy Server as a service with Upstart](https://denbeke.be/blog/servers/running-caddy-server-as-a-service/). +Short recap: + +* Download Caddy in `/usr/bin/caddy` and execute `sudo setcap cap_net_bind_service=+ep /usr/bin/caddy`. +* Save the upstart config file in `/etc/init/caddy.conf`. +* Create a Caddyfile in `/etc/caddy/Caddyfile`. +* Now you can use `sudo service caddy start|stop|restart`. \ No newline at end of file diff --git a/dist/init/linux-upstart/caddy.conf b/dist/init/linux-upstart/caddy.conf new file mode 100644 index 00000000..bddc9ac7 --- /dev/null +++ b/dist/init/linux-upstart/caddy.conf @@ -0,0 +1,18 @@ +description "Caddy startup script" +author "Mathias Beke" + +start on runlevel [2345] +stop on runlevel [016] + + +setuid www-data +setgid www-data + +respawn +respawn limit 10 5 + +limit nofile 4096 4096 + +script + exec /usr/bin/caddy -agree=true -conf=/etc/caddy/Caddyfile +end script \ No newline at end of file