1. The problem I’m having:
I am attempting so serve a static website from a Debian 12 server using Caddy.
Problem 1:
I entered this command <caddy file-server --domain example.com> and received the following error.
Error: loading new config: http app module: start: listening on :80: listen tcp :80: bind: address already in use
I am attempting to correct the error with a Caddyfile but I am unsure of where to save the Caddyfile.
2. Error messages and/or full log output:
Error: loading new config: http app module: start: listening on :80: listen tcp :80: bind: address already in use
3. Caddy version: v2.6.4
4. How I installed and ran Caddy:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
a. System environment:
Debian 12
Website files are saved in /SRV/example
b. Command:
caddy file-server --domain example.com
c. Service/unit/compose file:
d. My complete Caddy config:
I would like to create a Caddyfile but I am unsure where I should save it.