Control Web Panel
WebPanel => Apache => Nginx => Topic started by: kdwbmstr on July 05, 2022, 01:36:10 PM
-
Since à few sans, all my sites hosted on my cwp are shoping 502 Bad Gateway nginx/1.20.2.
Tried all classic stuff
- checked and fixer wordpress défaut rights
- rebuild webserver nginx
Please anyone have any hint?
-
+1 me too
-
Did you manage to solve it?
-
Need to see some error logs to nail it down...
-
I do have had this problem and believe it is related to the .sock file missing for the user.
2023/04/11 06:59:29 [crit] 5018#5018: *113 connect() to unix:/opt/alt/php-fpm80/usr/var/sockets/whocalau.sock failed (13: Permission denied) while connecting to upstream, client: 103.154.154.179, server: whocalled.au, request: "GET /wp-admin/plugin-install.php?s=w3%2520total&tab=search&type=term HTTP/1.1", upstream: "fastcgi://unix:/opt/alt/php-fpm80/usr/var/sockets/whocalau.sock:", host: "whocalled.au", referrer: "https://whocalled.au/wp-admin/plugins.php"
I rectified it temporarily by modifying my website .conf file to change the socket file to nobody.sock but it just means I lose some functionality in the backend of the Wordpress site, like not being able to install plugins directly and getting some permissions errors.
This is NOT a permanent fix. I would love to have a better solution.
-
When compiling new php-fpm versions, you don't automatically get a user.conf file created (and therefore a user.sock file). You should copy over your existing user.conf from the previous PHP version, change the paths therein appropriately for that PHP version, and restart that version of php-fpm. Also, I see you are using php 8.0. Any specific reason you are not using 8.1 instead? If not, I would recommend compiling 8.1 and using that instead of 8.0.
-
When compiling new php-fpm versions, you don't automatically get a user.conf file created (and therefore a user.sock file). You should copy over your existing user.conf from the previous PHP version, change the paths therein appropriately for that PHP version, and restart that version of php-fpm.
But I don't have an existing sock file to copy from unless I missing something? Where should I be looking for an existing one?
restart that version of php-fpm.
How do you do this? I've tried multiple commands and Google's with 0 success.
Also, I see you are using php 8.0. Any specific reason you are not using 8.1 instead? If not, I would recommend compiling 8.1 and using that instead of 8.0.
Just what I have started off with and some of my WordPress plugins are not compatible with 8.1 yet.
-
Here's an example for moving from php-fpm 7.4 to 8.0:
cp /opt/alt/php-fpm74/usr/etc/php-fpm.d/users/user.conf /opt/alt/php-fpm81/usr/etc/php-fpm.d/users/user.conf
Then edit the file (either manually or with a perl or sed substitution) to update it from 7.4 to 8.0:
perl -pi -e 's/php-fpm74/php-fpm80/g' /opt/alt/php-fpm81/usr/etc/php-fpm.d/users/user.conf
Then restart php 8.0
systemctl restart php-fpm80.service
and confirm it made your .sock file:
ls -l /opt/alt/php-fpm80/usr/var/sockets/yellowdeli.sock
If it's present, then restart nginx.