502 on phpmyadmin

I’m getting a Cloudflare 502 error on mydomainorg/phpmyadmin/ (while logged in Hestia).
please advise, thanks.

nginx error log:

2023/12/14 22:30:42 [error] 1549306#1549306: *28799 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 112.164.16.229, server: mydomainorg, request: “GET /phpmyadmin/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “mydomainorg”, referrer: “https://mydomainorg:2053/

I have 5 “www.conf” files (lol for good measure… and uncertainty), each in :
/etc/php/7.3/fpm/pool.d/
/etc/php/7.4/fpm/pool.d/
/etc/php/8.0/fpm/pool.d/
/etc/php/8.1/fpm/pool.d/
/etc/php/8.2/fpm/pool.d/

Contents of each:

; origin-src: deb/php-fpm/www.conf

[www]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

user = www-data
group = www-data

pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 10s

You should have only one www.conf file, in the default php 8.2. Remove www.conf file from the other dirs. Righ now, you are trying to start fpm service on port 9000 5 times… and that’s not possible.

Note: remember to restart php fpm services.

What is the version of Hestia that you are using? I’m asking because since 1.8.9 user should be hestiamail.

thanks sahsanu,

I’ve deleted all www.conf, only kept /etc/php/8.2/fpm/pool.d/www.conf

; origin-src: deb/php-fpm/www.conf

[www]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

user = hestiamail
group = www-data

pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 10s

Hestia 1.8.11

I’ve restarted nginx/php7.3/7.4/8.0/8.1/8.2, but am still getting a Cloudflare 502 on https://mydomain/phpmyadmin.
Same log error in : /var/log/nginx/domains/mydomain.error.log

Change perms:

chown -R root:www-data /etc/phpmyadmin/
chown -R hestiamail:www-data /usr/share/phpmyadmin/tmp/

I’ve changed the permissions, per instructions.
Still the same error 502.

This is standard Hestia installation 1.8.11.
/usr/share/phpmyadmin/tmp was previously root:hestiamail

What is the port used by Hestia?

port 2053

Indeed, I did change the port, to make it more secure.

Bypassing Cloudflare works? I mean, not using the Cloudflare’s proxy…

Just keep in mind that changing the port won’t made it more secure, maybe it could be a bit “harder” to reach it but won’t be more secure :wink:

Just tried bypassing Cloudflare, unfortunately did not work.

When Cloudflare is on, I get a 502 error.
When Clouflare is off, I get a 500 error.

Show the logs for nginx and apache when you receive the 500 error.

Access log:

142.139.11.111 - - [15/Dec/2023:21:32:30 +0000] “GET /phpmyadmin/ HTTP/1.1” 502 2869 “https://mydomaincom:2053/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0”

Error log:

2023/12/15 21:32:30 [error] 1060#1060: *2454 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 142.139.11.111, server: mydomaincom, request: “GET /phpmyadmin/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “mydomaincom”, referrer: “https://mydomaincom:2053/

I only use Nginx.
Thank you for your persistence.

Wait a minute, are you trying to access to https://mydomaincom:2053/phpmyadmin ? Because that shouldn’t work, https://mydomaincom/phpmyadmin should work (at least without Cloudflare proxying the connection).

Just in case, show the output of this command:

lsof -Pn +c0 -i:9000 -sTCP:LISTEN

Indeed, I’m trying https://mydomaincom/phpmyadmin/

root@host:~# lsof -Pn +c0 -i:9000 -sTCP:LISTEN
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php-fpm8.2 877 root   11u  IPv4  23063      0t0  TCP 127.0.0.1:9000 (LISTEN)

What is the Nginx template you are using for your web site?

Could you please send me a private message and let me know your actual domain and ip?

The nginx template is WordPress.

thanks, PM’ed you.

1 Like