1. Caddy version (caddy version
):
V2.5.2
2. How I run Caddy:
Using with Rocketchat server as reverse proxy (Snap from Ubuntu server 22.04). Removed whatever instance of Caddy was already included since it wouldn’t start or stop, added repository for Caddy and installed it fresh thinking that might help.
a. System environment:
Ubuntu Server 22.04 fresh install, installed Caddy using Snap during the server setup process. Maybe the Snap package isn’t worth using?
b. Command:
sudo systemctl start caddy
c. Service/unit/compose file:
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
wowsers.duckdns.org {
# Set this path to your site's directory.
root * /var/snap/rocketchat-server/1520/ {
# Enable the static file server.
file_server
# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
}
}
3. The problem I’m having:
Caddy refuses to start or stop.
4. Error messages and/or full log output:
$ systemctl status caddy.service
× caddy.service - Caddy
Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabl>
Active: failed (Result: exit-code) since Fri 2022-07-15 01:52:32 UTC; 1min 13s a>
Docs: https://caddyserver.com/docs/
Process: 13381 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfi>
Main PID: 13381 (code=exited, status=1/FAILURE)
CPU: 29ms
Jul 15 01:52:32 ubuntu-server caddy[13381]: LOGNAME=caddy
Jul 15 01:52:32 ubuntu-server caddy[13381]: USER=caddy
Jul 15 01:52:32 ubuntu-server caddy[13381]: INVOCATION_ID=e72cd2c501b24a1e8e0747cd7c6>
Jul 15 01:52:32 ubuntu-server caddy[13381]: JOURNAL_STREAM=8:44712
Jul 15 01:52:32 ubuntu-server caddy[13381]: SYSTEMD_EXEC_PID=13381
Jul 15 01:52:32 ubuntu-server caddy[13381]: {"level":"info","ts":1657849952.6782744,">
Jul 15 01:52:32 ubuntu-server caddy[13381]: run: adapting config using caddyfile: par>
Jul 15 01:52:32 ubuntu-server systemd[1]: caddy.service: Main process exited, code=ex>
Jul 15 01:52:32 ubuntu-server systemd[1]: caddy.service: Failed with result 'exit-cod>
Jul 15 01:52:32 ubuntu-server systemd[1]: Failed to start Caddy.
$ journalctl -xeu caddy.service
Jul 15 01:52:32 ubuntu-server caddy[13381]: INVOCATION_ID=e72cd2c501b24a1e8e0747cd7c6>
Jul 15 01:52:32 ubuntu-server caddy[13381]: JOURNAL_STREAM=8:44712
Jul 15 01:52:32 ubuntu-server caddy[13381]: SYSTEMD_EXEC_PID=13381
Jul 15 01:52:32 ubuntu-server caddy[13381]: {"level":"info","ts":1657849952.6782744,">
Jul 15 01:52:32 ubuntu-server caddy[13381]: run: adapting config using caddyfile: par>
Jul 15 01:52:32 ubuntu-server systemd[1]: caddy.service: Main process exited, code=ex>
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit caddy.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Jul 15 01:52:32 ubuntu-server systemd[1]: caddy.service: Failed with result 'exit-cod>
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit caddy.service has entered the 'failed' state with result 'exit-code'.
Jul 15 01:52:32 ubuntu-server systemd[1]: Failed to start Caddy.
░░ Subject: A start job for unit caddy.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit caddy.service has finished with a failure.
░░
░░ The job identifier is 25659 and the job result is failed.
5. What I already tried:
Rebooted server, tried editing the caddy server file. I’m sorry but I haven’t used Caddy before, so I’m probably noobing it up good and proper in here.
6. Links to relevant resources:
I am following the documentation for Snap on Rocketchats website. It appears I cannot post links as a new user.