Today I updated my Ubuntu Server to 12.04.5 LTS (release 12.04, codename: precise), and got “502 Bad Gateway” on all my websites.
I checked Nginx log files and found that Nginx cannot open the socket created by PHP-FPM:
2014/09/11 19:01:03 [crit] 2741#0: *107 connect() to unix:/var/run/www-devnote.sock failed (13: Permission denied) while connecting to upstream, client: XXX.XX.X.XX, server: ~^(www\.)?(?<domain>.+)$, request: “GET /2014/04/using-a-wpf-control-in-a-mfc-application/ HTTP/1.1”, upstream: “fastcgi://unix:/var/run/www-devnote.sock:”, host: “developernote.com”
This is a draft version of the post. It’ll be revised.
Installing Ubuntu Server
- Download the latest version of Ubuntu Server. Note that it is not possible to convert Ubuntu 32 bit to 64 bit. The only way is to do a clean install.
- Create a bootable USB stick using Pen Drive Linux’s USB Installer.
- Boot up from USB and install Ubuntu Server. During the installation you can switch to terminal mode by pressing Alt+F2 and switch back by pressing Alt+F1.
Update the server:
Today to my grate surprise I got “502 Bad Gateway” error while trying to open some specific URL on my web site:
I took a look at the Nginx log file located in /var/log/nginx/ directory on my machine and seen the following: