I am running a WordPress blog using nginx + PHP + spawn-fcgi and it works fine, but once a day spawn-fcgi seems to crash.
This is not so good, because then there is always the need to restart the spawn-fcgi process, which is annoying if you need to do this manually. So I thought it might be good to to this in a automatic way.
Note: This is not a real solution for this problem, because it doesn’t resolve the problem it just saves you some time. Image may be NSFW.
Clik here to view.
A nice & easy way is to use monit as a proactive monitoring solution for this. Because I am using Debian I will install it using:
apt-get install monit
After that we have the files
- /etc/default/monit and
- /etc/monit/monitrc
/etc/init.d/monit start
Monit is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.
The post ‘502 Bad Gateway’ when running WordPress with spawn-fcgi nginx php appeared first on Happy Coding Journal.