Caddy use to work fine under Ubuntu 16.04.5 but after upgrading to 18.04.1 caddy fails to launch.
sudo journalctl -xef -u caddy.service
:
Sep 17 02:09:46 ubuntu caddy[9872]: Activating privacy features... done.
Sep 17 02:09:46 ubuntu caddy[9872]: 2018/09/17 02:09:46 listen tcp :80: bind: address already in use
Sep 17 02:09:46 ubuntu systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Sep 17 02:09:46 ubuntu systemd[1]: caddy.service: Failed with result 'exit-code'.
Sep 17 02:09:51 ubuntu systemd[1]: Started Caddy HTTP/2 web server.
-- Subject: Unit caddy.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit caddy.service has finished starting up.
--
-- The start-up result is RESULT.
Sep 17 02:09:51 ubuntu caddy[9915]: Activating privacy features... done.
Sep 17 02:09:51 ubuntu caddy[9915]: 2018/09/17 02:09:51 listen tcp :443: bind: address already in use
Sep 17 02:09:51 ubuntu systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Sep 17 02:09:51 ubuntu systemd[1]: caddy.service: Failed with result 'exit-code'
michael@ubuntu:~$ netstat -ano | grep :80
tcp6 0 0 :::80 :::* LISTEN off (0.00/0/0)
michael@ubuntu:~$ netstat -ano | grep :443
tcp6 0 0 :::443 :::* LISTEN off (0.00/0/0
Things I’ve tried so far:
- From Caddy won't start - Could not start HTTP server for challenge -> listen tcp :80: bind: permission denied - #3 by gurubobnz, I uncommented these lines from my caddy.service file
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
- I also tried
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy
which should have done something similar but that didn’t work either.
I’m not sure exactly what I’m missing. Can anyone help me with this?