Setup Wordpress subdomain

1. Caddy version (caddy version):

v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=

2. How I run Caddy:

a. System environment:

OS Armbian 20.11.6 Buster with Linux 5.9.14-rockchip64
No docker
systemd rule to run caddy when boot

b. Command:

caddy run

c. Service/unit/compose file:

paste full file contents here

d. My complete Caddyfile or JSON config:

mydomain.me {
	root * /var/www/html/mydomain
	file_server
}

athing.mydomain.me {
	root * /var/www/html/athing
	file_server
}

blog.mydomain.me {
	root * /var/www/html/blog
	php_fastcgi unix//run/php/php-fpm.sock
	encode gzip
	file_server
}

torrent.mydomain.me {
	basicauth /* {
		OursBlanc JDJhmkcycG1LmneU9JWTBL1NJNOOEYDzdlvxTc3wSmE0JGdQJUWFF5NHdPRxvSRJYXdZuSUoY09tYjdT
	}
	log {
		format single_field common_log
		output file /var/log/caddy-torrent.log {
			roll_size 20MiB
			roll_keep 3
			roll_keep_for 48h
		}
	}
	reverse_proxy 192.168.1.5:9091
}

3. The problem I’m having:

Hi everyone ; I’m sorry to ask for your help, but I’ve been blowing off steam on this problem for a long time. I’m trying to administrate my server (self-hosting) and I can’t deploy wordpress with Caddy. I’ve been looking for a lot of help, I’ve read other messages about this on the forum: but nothing to do. I block. Most of the tutorials I found are related to Caddy V1 and didn’t help me.
I followed the official wordpress instructions :
Install PHP
Install mariadb
create database and user for mariadb
configure wp-config with this information

and I get an error 502…

thank you in advance for taking the time to answer me
i hope you have all the information to help me

(please excuse my ignorance and bad english)

4. Error messages and/or full log output:

HTTP ERROR 502

5. What I already tried:

I tried lot of configuration of Caddyfile espcially on the “blog” block. (but I didn’t write each configuration I tried.)

6. Links to relevant resources:

Don’t be, that’s what the forums are here for! :smiley:

Probably has to do with this line:

Make sure that php-fpm is running with the right settings to use a unix socket. It may default to using a TCP socket, i.e. 127.0.0.1:9000 instead.

A 502 error means Caddy wasn’t able to connect to the upstream. In this case, likely your fastcgi service (php-fpm).

1 Like

Hi @francislavoie , thank for your answer.
As I said, I am completely new to these subjects. I have no idea what “php_fastcgi” does (I tried to understand but it’s beyond my knowledge). On the other hand, your message allowed me to detect exactly what is stuck, and to do the appropriate research on the Internet (when we know what we are looking for, it works better :smiley: )

Moreover, I didn’t have the right version of PHP and I was missing two extensions, php-mysql and php-fpm…

Anyway, thank you very much for taking the time to answer me :smiley:

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.