root@wordpress:/ # caddy
Caddy is an extensible server platform.
usage:
caddy <command> [<args...>]
commands:
adapt Adapts a configuration to Caddy's native JSON
build-info Prints information about this build
environ Prints the environment
file-server Spins up a production-ready file server
fmt Formats a Caddyfile
hash-password Hashes a password and writes base64
help Shows help for a Caddy subcommand
list-modules Lists the installed Caddy modules
reload Changes the config of the running Caddy instance
reverse-proxy A quick and production-ready reverse proxy
run Starts the Caddy process and blocks indefinitely
start Starts the Caddy process in the background and then returns
stop Gracefully stops a started Caddy process
trust Installs a CA certificate into local trust stores
untrust Untrusts a locally-trusted CA certificate
validate Tests whether a configuration file is valid
version Prints the version
Use 'caddy help <command>' for more information about a command.
Full documentation is available at:
https://caddyserver.com/docs/command-line
root@wordpress:/ # caddy adapt /usr/local/www/Caddyfile
adapt: input file required when there is no Caddyfile in current directory (use --config flag)
root@wordpress:/ #
root@wordpress:/ # caddy adapt --config /usr/local/www/Caddyfile
adapt: /usr/local/www/Caddyfile:15: unrecognized directive: error
root@wordpress:/ # caddy adapt -config /usr/local/www/Caddyfile
adapt: /usr/local/www/Caddyfile:15: unrecognized directive: error
root@wordpress:/ #
but that is not the story.
And nothing here : Upgrading to Caddy 2 — Caddy Documentation
Going to v2 is quite a frastration for alot of people given I have programming backgroup since DOS era where everything is commandline, I still have trouble with it.
Caddy 2 does not have a directive called error, which is why you’re getting the error message unrecognized directive: error. You can review the list of supported directives here.
Why is it frustrating? Have you tried reading the documentation? The upgrade guide? The tutorials? You have a lot of experience in the command line, how did you learn how to use the command line? How can we improve?
My first OS is MS-DOS 3.3
I can maybe still remember the different of major release all the way until 7.1
Back then MS 7.1 is like WOW , and imagine running MS-WORD in non-GUI
I have when through many times, and at one point I have two screen so I can compare v1 and v2.
adapt: /usr/local/www/Caddyfile:15: unrecognized directive: error
At first glance , from old school method, where error is identify by a number, and you have to look it up in the manual to find what does the number mean,
I read it : Adapt having unrecognized directive error : 15 , for file /usr/local/www/Caddyfile
format here doesn’t refer to a variable type or anything like that. The format subdirective allows you to specify an encoder module. The encoder module determines the format of the output. Valid options at the time of this post include console, json, logfmt, and single_field. See: log (Caddyfile directive) — Caddy Documentation