Latest version of Caddy here. What I am trying to do is not do the following every time I update the Caddyfile in /etc/caddy:
killall caddy
rm ~/.config/caddy/caddyfile.json
caddy stop
caddy start
So like an option to change the Caddyfile and then do caddy reload without having to delete files or kill a process. The idea is for me to add a new domain or update an existing domain and then the reload or whatever command can refresh the current running process.
You just need to run caddy reload --config /etc/caddy/Caddyfile
How did you install Caddy?
Please fill out the help topic template, I can’t really say much more without proper context, which answers to the help topic template would clarify.
Sorry, I installed it via the PPA in Ubuntu. This way:
Then you should use sudo systemctl caddy reload
if you’re running Caddy as a service (which the PPA automatically sets up)
And that would reload the Caddyserver file with the new changes? Also how would that differ just so I can understand from the reload option? Would the systemctl know where the Caddyfile is in the /etc/caddy folder?
It’s defined in the service file:
# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
This file has been truncated. show original
2 Likes
system
(system)
Closed
August 20, 2021, 6:55pm
8
This topic was automatically closed after 30 days. New replies are no longer allowed.