If you are using TCP sockets then this will be your Monit configuration. If failed unixsocket /var/run/ then restart Stop program = "/usr/sbin/service php7.4-fpm stop" Start program = "/usr/sbin/service php7.4-fpm start" with timeout 60 seconds Monit is also going to check that the php7.4-fpm unix socket exists: /var/run/Ĭheck process php7.4-fpm with pidfile /run/php/ It checks for the file and if it doesn’t exist Monit will try to restart it. This Monit php7.4-fpm configuration is for Unix sockets. Now we have the information necessary to configure Monit for php7-fpm monitoring.Ĭreate a Monit php7-fpm configuration, you may use the conf-enabled folder instead of conf.d, check your /etc/monit/monitrc file to verify. If you see this output then php7.4-fpm is using TCP sockets, the loopback interface 127.0.0.1 on port 9090 If you see this output then php7.4-fpm is using Unix sockets Grep "listen =" /etc/php/7.4/fpm/pool.d/www.conf Php7-fpm can listen on either Unix sockets or TCP sockets. We will use the socket php7-fpm is using and its PID file. Monit needs some information to check to see if php7.4-fpm is healthy. Use Monit to Monitor + Restart PHP7.4-FPM Service Automatically Monit will check the php7.4-fpm, Nginx and MySQL processes by looking at the PID they are listening on and if the PID can not be found or detected Monit will find the services and restart them. Monit will make sure php7.4-fpm and any server web services are always running in case it halts or freezes up. Monit is an excellent tool to check your server’s services uptime, Monit is “Pro-active Monitoring” used on VPS or dedicated server. In order to follow this guide, you should have a server with Ubuntu 18.04.4 LTS installed with 1GB minimal memory and 10GB minimal hard drive, access to sudo privileges, php7.4, nginx and mysql.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |