I have zero knowledge about this stuff, learning as I go.
I’m trying to add a TLS certificate to my domain to use locally. The certificate that is being used by caddy requires a refresh every so often, and to ignore the unsafe certificate warning when I have all the subdomains open in the browser. I want that to stop, if that’s possible.
user@host:~$ caddy reload --config /etc/caddy/Caddyfile
2024/01/31 05:44:58.588 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
Error: adapting config using caddyfile: parsing caddyfile tokens for 'tls': getting module named 'dns.providers.godaddy': module not registered: dns.providers.godaddy, at /etc/caddy/Caddyfile:16
After making the build, you need to move the build binary to replace the existing one. Then you have to restart Caddy, (not reload) to make it use the new process. A reload is an in-process config reload, it doesn’t use the new process.
I followed the instruction but received this error:
user@host:~$ sudo systemctl restart caddy
Job for caddy.service failed because the control process exited with error code.
See "systemctl status caddy.service" and "journalctl -xeu caddy.service" for details.
skepticalme@PlexServer:~$ systemctl status caddy.service
× caddy.service - Caddy
Loaded: loaded (/lib/systemd/system/caddy.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-01-31 17:23:43 AEDT; 20s ago
Duration: 1d 5h 44min 24.067s
Docs: https://caddyserver.com/docs/
Process: 2654960 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=203/EXEC)
Main PID: 2654960 (code=exited, status=203/EXEC)
CPU: 30ms
Jan 31 17:23:43 PlexServer systemd[1]: Starting caddy.service - Caddy...
Jan 31 17:23:43 PlexServer (caddy)[2654960]: caddy.service: Failed to locate executable /usr/bin/caddy: Is a directory
Jan 31 17:23:43 PlexServer (caddy)[2654960]: caddy.service: Failed at step EXEC spawning /usr/bin/caddy: Is a directory
Jan 31 17:23:43 PlexServer systemd[1]: caddy.service: Main process exited, code=exited, status=203/EXEC
Jan 31 17:23:43 PlexServer systemd[1]: caddy.service: Failed with result 'exit-code'.
Jan 31 17:23:43 PlexServer systemd[1]: Failed to start caddy.service - Caddy.
I couldn’t restart caddy, so I did this to get it going for now (I also edited the Caddyfile to remove the domain). Thank you for your help, I really want to solve this:
skepticalme@PlexServer:~$ sudo update-alternatives --config caddy
There are 2 choices for the alternative caddy (providing /usr/bin/caddy).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/caddy.custom 50 auto mode
1 /usr/bin/caddy.custom 50 manual mode
2 /usr/bin/caddy.default 10 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/caddy.default to provide /usr/bin/caddy (caddy) in manual mode
skepticalme@PlexServer:~$ sudo systemctl restart caddyskepticalme@PlexServer:~$
What?!? That looks like you checked out the Caddy source in that location. That’s totally wrong.
Please show the commands you ran to get to that point.
Run rm -rf /usr/bin/caddy to wipe that out.
The Caddy program is supposed to be a single file called caddy and placed in /usr/bin. When you run xcaddy build, it produces that program in your current directory. You’re meant to move it afterwards to the right place for your system.
This is what is in /home, the file caddy is there:
skepticalme@PlexServer:~$ ls
ls: cannot access 'S3DriveMount': Transport endpoint is not connected
caddy go Pictures Templates
Desktop immich-app Public Videos
Documents Music S3DriveMount
Downloads paperless-ngx snap
That doesn’t explain why you would have Caddy’s source unpacked in /usr/bin/caddy. Those commands don’t do that. You must have done something weird before then.
Feb 01 07:01:27 PlexServer caddy[3581346]: LOGNAME=caddy
Feb 01 07:01:27 PlexServer caddy[3581346]: USER=caddy
Feb 01 07:01:27 PlexServer caddy[3581346]: INVOCATION_ID=e075884fb98f42a6bf4aaee87aa6c318
Feb 01 07:01:27 PlexServer caddy[3581346]: JOURNAL_STREAM=8:36250791
Feb 01 07:01:27 PlexServer caddy[3581346]: SYSTEMD_EXEC_PID=3581346
Feb 01 07:01:27 PlexServer caddy[3581346]: {"level":"info","ts":1706731287.907511,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Feb 01 07:01:27 PlexServer caddy[3581346]: Error: adapting config using caddyfile: parsing caddyfile tokens for 'tls': getting module named 'dns.providers.godaddy': module not registered: dns.providers.godaddy, at /etc/caddy/Caddyfile:21
Feb 01 07:01:27 PlexServer systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Feb 01 07:01:27 PlexServer systemd[1]: caddy.service: Failed with result 'exit-code'.
Feb 01 07:01:27 PlexServer systemd[1]: Failed to start caddy.service - Caddy.
skepticalme@PlexServer:~$ which caddy
/usr/bin/caddy
skepticalme@PlexServer:~$ caddy list-modules -s
dns.providers.godaddy
Non-standard modules: 1
Unknown modules: 0
skepticalme@PlexServer:~$ update-alternatives --config caddy
There are 2 choices for the alternative caddy (providing /usr/bin/caddy).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/caddy.custom 50 auto mode
1 /usr/bin/caddy.custom 50 manual mode
* 2 /usr/bin/caddy.default 10 manual mode
Press <enter> to keep the current choice[*], or type selection number:
You don’t need to write both https:// and :443, they’re redundant. Caddy defaults to HTTPS anyway, so you can simplify it to just stirlingpdf.sceptic.au {
Aside from that, I can’t say whether any sites are not needed, that’s entirely up to you to decide what you do and don’t need.