I have been trying to move my WordPress installation from an old host to a new host, where there is one significant difference: Old host was running caddyv1.0.4. I have also included that Caddy file up above.
I seem to get 404’s with wget, and a blank white screen using a regular browser.
A buddy helped me update my Cadddyfile to the newer way of doing things,
I have added the log directive to find out what was going on, that did not help me much hence I am asking here.
I followed this blog post, Serving WordPress with Caddy 2 - Thomas Bensmann, to no avail.
Setting level DEBUG doesn’t really do anything useful here. What you want is to set the debug global option at the top of your Caddyfile:
{
debug
}
Then run this command to see your logs:
journalctl -u caddy --no-pager | less
The log directive only gives you access logs, but not the rest. The rest is written to stdout, which you can see by looking at the journal, since you’re running as a systemd service.
I’m not sure what the source of the 404 is. It could be from the file_server handler, but I think more likely is from the wordpress app itself. The error logs may reveal more relevant info.
After reading, Primary script unknown I decided to try and run the old host’s config on the new host using the same caddy version (1.0.4), which pointed to the error described in that link. So I have now tried to edit the PHP-FPM configuration to allow Caddy to run with its own unix socket. Including setting up caddy to use its own socket, making sure that the socket is run under that users name, etc. That did not work, 404. Then I tried changing the user under which caddy runs when using systemctl start caddy to be www-data, which also did not work - again a 404. So I am at a loss now.
This leads to several questions, why can’t I run the same caddy version with the same config as the old host on the new host? Why won’t this setup run on the new host with its own unix socket/etc?
Is there anything else I can do to try and get it to work?
Because running very outdated software is a terrible idea. Caddy v1 is EOL. So is PHP 7.0. For that matter, PHP 7.3 is nearing EOL at the end of the year PHP: Supported Versions
Did you try what I suggested, to look at your logs?