1. Caddy version (caddy version
):
v2.5.0-beta.1 h1:lF5wWqqDJ6HjETbnBILvTAeKcThsz1+OeWB+d1tWxp4=
2. How I run Caddy:
a. System environment:
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs
b. Command:
caddy run --config /etc/caddy/Caddyfile
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.
:80 {
# Set this path to your site's directory.
# root * /usr/share/caddy
# Enable the static file server.
# file_server
# Another common task is to set up a reverse proxy:
reverse_proxy localhost:1080
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
3. The problem I’m having:
I get an error that my user does not have relevant permissions to bind to port 80.
4. Error messages and/or full log output:
pi@raspberrypi:~ $ caddy run --config /etc/caddy/Caddyfile
2022/03/15 17:56:49.193 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
2022/03/15 17:56:49.197 INFO admin admin endpoint started {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["//127.0.0.1:2019", "//localhost:2019", "//[::1]:2019"]}
2022/03/15 17:56:49.198 WARN http server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 80}
2022/03/15 17:56:49.198 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0x2d23d60"}
2022/03/15 17:56:49.199 INFO tls cleaning storage unit {"description": "FileStorage:/home/pi/.local/share/caddy"}
2022/03/15 17:56:49.199 INFO tls finished cleaning storage units
2022/03/15 17:56:49.199 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0x2d23d60"}
run: loading initial config: loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: permission denied
5. What I already tried:
This is similar to the other issue here:
Based on that discussion, I revisited the installation guide that I used:
If I understand correctly, Caddy is already installed as a systemd service. When I check its status, I see the same error:
pi@raspberrypi:~ $ systemctl status caddy
â—Ź caddy.service - Caddy
Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-03-15 17:49:16 GMT; 9min ago
Docs: https://caddyserver.com/docs/
Process: 12216 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 12216 (code=exited, status=1/FAILURE)
Mar 15 17:49:16 raspberrypi caddy[12216]: {"level":"warn","ts":1647366556.7552323,"logger":"http","msg":"server is list
Mar 15 17:49:16 raspberrypi caddy[12216]: {"level":"info","ts":1647366556.755231,"logger":"tls.cache.maintenance","msg"
Mar 15 17:49:16 raspberrypi caddy[12216]: {"level":"info","ts":1647366556.7563884,"logger":"tls","msg":"cleaning storag
Mar 15 17:49:16 raspberrypi caddy[12216]: {"level":"info","ts":1647366556.7564585,"logger":"tls","msg":"finished cleani
Mar 15 17:49:16 raspberrypi caddy[12216]: {"level":"info","ts":1647366556.7565138,"logger":"tls.cache.maintenance","msg
Mar 15 17:49:16 raspberrypi caddy[12216]: run: loading initial config: loading new config: http app module: start: tcp:
Mar 15 17:49:16 raspberrypi systemd[1]: Started Caddy.
Mar 15 17:49:16 raspberrypi systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Mar 15 17:49:16 raspberrypi systemd[1]: caddy.service: Failed with result 'exit-code'.
Mar 15 17:49:46 raspberrypi systemd[1]: caddy.service: Unit cannot be reloaded because it is inactive.
6. Links to relevant resources:
NA