paste config here, replacing this text
DO NOT REDACT anything except credentials
3. The problem I’m having:
I installed caddy v2 over the top of v1 and when I do “caddy version” I get the following error;
“args:2 - Error during parsing: Unknown directive ‘version’”
When I do “caddy -version” it returns v1.0.4. It’s as though something hasn’t overwrote after installing v2.
I could not find any info what so ever on how to remove version 1 properly.
Thank you. So the apt pkg installs the binary in /usr/bin, but you have the old caddy placed in /usr/local/bin/caddy. If you run echo $PATH you’ll see /usr/local/bin somewhere to the left of /usr/bin. This means when you run the command caddy, the OS will search for the executable through the directories listed in $PATH from left to right, and will find it in /usr/local/bin (which is v1) before it finds the one in /usr/bin (which is v2).
If your “installation” of v1 was using getcaddy.com or manually placing the executable in /usr/local/bin, then resolving this should be as simple as removing the /usr/local/bin/caddy executable.
I removed the executable from "/usr/local/bin/caddy" then "sudo systemctl restart caddy". I then did a "which caddy" and got "/usr/bin/caddy". I then did "caddy version" and got "-bash: /usr/local/bin/caddy: No such file or directory".