Mins / TuxLite

A complete LAMP and LNMP setup script for Debian or Ubuntu
http://tuxlite.com
253 stars 112 forks source link

Issue with php5-fpm leading to 502 Bad Gateway errors #45

Closed vanarp closed 6 years ago

vanarp commented 10 years ago

After a recent patches update (aptitude safe-upgrade) started experiencing "502 Bad Gateway" error for all the sites on the server running Ubuntu 12.04.

The solution that worked is as described by someone here: http://ubuntuforums.org/showthread.php?t=2231143

I uncommented the three lines and made sure listen.mode is equal to 0660 in *.conf files present under /etc/php5/fpm/pool.d/ folder. Then restarted php5-fpm.

Before the above fix:

root@vzssd5:/var/run# ls -ltr *.sock srw-rw---- 1 root root 0 Jul 3 06:58 php5-fpm-www-data.sock srw-rw---- 1 root root 0 Jul 3 06:58 php5-fpm-vanarp.sock

After the above fix:

root@vzssd5:/var/run# ls -ltr *.sock srw-rw---- 1 www-data www-data 0 Jul 3 13:26 php5-fpm-www-data.sock srw-rw---- 1 www-data www-data 0 Jul 3 13:26 php5-fpm-vanarp.sock

I am not sure if this will be an issue for newer installations. May need further testing with other Linux distros/versions.

Mins commented 10 years ago

Hi, this was discussed earlier. Refer to issue #39