Configure Monit to monitor PHP5-FPM on Ubuntu/Nginx setup Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Come Celebrate our 10 Year Anniversary!Blank Page: wordpress on nginx+php-fpmmysql monitoring with monitConfigure php5-fpm for many concurrent userscannot restart php5-fpmnginx php5-fpm path_info urls and root locationphp5-fpm does not initialize after ubuntu 12.04 rebootNGINX don't parse .php5 as .phpphp5-fpm doesn't create sockets for poolsCodeIgniter nginx rewrite rules for i8ln URL'sPeculiar NGinx / PHP5-FPM behavior

Multi tool use
Multi tool use

Lights are flickering on and off after accidentally bumping into light switch

Recursive calls to a function - why is the address of the parameter passed to it lowering with each call?

Etymology of 見舞い

How to create a command for the "strange m" symbol in latex?

Is the Mordenkainen's Sword spell underpowered?

Determine the generator of an ideal of ring of integers

Why isn't everyone flabbergasted about Bran's "gift"?

How do I deal with an erroneously large refund?

lm and glm function in R

Can gravitational waves pass through a black hole?

Like totally amazing interchangeable sister outfit accessory swapping or whatever

Coin Game with infinite paradox

Why do C and C++ allow the expression (int) + 4*5?

Is there a verb for listening stealthily?

"Destructive force" carried by a B-52?

What is the definining line between a helicopter and a drone a person can ride in?

Are Flameskulls resistant to magical piercing damage?

Pointing to problems without suggesting solutions

Does using the Inspiration rules for character defects encourage My Guy Syndrome?

Why do people think Winterfell crypts is the safest place for women, children & old people?

/bin/ls sorts differently than just ls

Compiling and throwing simple dynamic exceptions at runtime for JVM

Why is one lightbulb in a string illuminated?

Does traveling In The United States require a passport or can I use my green card if not a US citizen?



Configure Monit to monitor PHP5-FPM on Ubuntu/Nginx setup



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Come Celebrate our 10 Year Anniversary!Blank Page: wordpress on nginx+php-fpmmysql monitoring with monitConfigure php5-fpm for many concurrent userscannot restart php5-fpmnginx php5-fpm path_info urls and root locationphp5-fpm does not initialize after ubuntu 12.04 rebootNGINX don't parse .php5 as .phpphp5-fpm doesn't create sockets for poolsCodeIgniter nginx rewrite rules for i8ln URL'sPeculiar NGinx / PHP5-FPM behavior



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















System: LEMP running on Ubuntu 14.04



I'm trying to configure the tool Monit to restart Nginx or PHP-FPM if ever there is a problem. It is correctly monitoring Nginx however under status for PHP-FPM it says "Not Monitoring". Apparently I'm having it check the wrong location.



Here is my Nginx configuration for PHP-FPM that is running on a socket:



location ~ .php$ ## Execute PHP scripts
if (!-e $request_filename) rewrite / /index.php last; ## Catch 404s that try_files miss

expires off; ## Do not cache dynamic content
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; ## See /etc/nginx/fastcgi_params

fastcgi_keep_conn on; #hhvm param



Here is my Monit configuration for both Nginx and PHP-FPM:



## Check Nginx
check process nginx with pidfile /var/run/nginx.pid
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
## Check PHP-FPM
check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
group www-data #change accordingly
start program = "/etc/init.d/php5-fpm start"
stop program = "/etc/init.d/php5-fpm stop"
if failed unixsocket /var/run/php-fpm/php-fpm.sock then restart
if 3 restarts within 5 cycles then timeout


I went with the suggested start and stop recommendations despite always restarting with "service php5-fpm restart".



My group - according to /etc/php5/fpm/pool.d/www.conf - is "group = www-data". I checked my php-fpm.conf and noticed that the PID file is being created at /var/run/php5-fpm.pid so I changed that. Then Monit said "Initializing" followed by "Connection failed". Any suggestions?










share|improve this question




























    0















    System: LEMP running on Ubuntu 14.04



    I'm trying to configure the tool Monit to restart Nginx or PHP-FPM if ever there is a problem. It is correctly monitoring Nginx however under status for PHP-FPM it says "Not Monitoring". Apparently I'm having it check the wrong location.



    Here is my Nginx configuration for PHP-FPM that is running on a socket:



    location ~ .php$ ## Execute PHP scripts
    if (!-e $request_filename) rewrite / /index.php last; ## Catch 404s that try_files miss

    expires off; ## Do not cache dynamic content
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params; ## See /etc/nginx/fastcgi_params

    fastcgi_keep_conn on; #hhvm param



    Here is my Monit configuration for both Nginx and PHP-FPM:



    ## Check Nginx
    check process nginx with pidfile /var/run/nginx.pid
    start program = "/etc/init.d/nginx start"
    stop program = "/etc/init.d/nginx stop"
    ## Check PHP-FPM
    check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
    group www-data #change accordingly
    start program = "/etc/init.d/php5-fpm start"
    stop program = "/etc/init.d/php5-fpm stop"
    if failed unixsocket /var/run/php-fpm/php-fpm.sock then restart
    if 3 restarts within 5 cycles then timeout


    I went with the suggested start and stop recommendations despite always restarting with "service php5-fpm restart".



    My group - according to /etc/php5/fpm/pool.d/www.conf - is "group = www-data". I checked my php-fpm.conf and noticed that the PID file is being created at /var/run/php5-fpm.pid so I changed that. Then Monit said "Initializing" followed by "Connection failed". Any suggestions?










    share|improve this question
























      0












      0








      0


      1






      System: LEMP running on Ubuntu 14.04



      I'm trying to configure the tool Monit to restart Nginx or PHP-FPM if ever there is a problem. It is correctly monitoring Nginx however under status for PHP-FPM it says "Not Monitoring". Apparently I'm having it check the wrong location.



      Here is my Nginx configuration for PHP-FPM that is running on a socket:



      location ~ .php$ ## Execute PHP scripts
      if (!-e $request_filename) rewrite / /index.php last; ## Catch 404s that try_files miss

      expires off; ## Do not cache dynamic content
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params; ## See /etc/nginx/fastcgi_params

      fastcgi_keep_conn on; #hhvm param



      Here is my Monit configuration for both Nginx and PHP-FPM:



      ## Check Nginx
      check process nginx with pidfile /var/run/nginx.pid
      start program = "/etc/init.d/nginx start"
      stop program = "/etc/init.d/nginx stop"
      ## Check PHP-FPM
      check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
      group www-data #change accordingly
      start program = "/etc/init.d/php5-fpm start"
      stop program = "/etc/init.d/php5-fpm stop"
      if failed unixsocket /var/run/php-fpm/php-fpm.sock then restart
      if 3 restarts within 5 cycles then timeout


      I went with the suggested start and stop recommendations despite always restarting with "service php5-fpm restart".



      My group - according to /etc/php5/fpm/pool.d/www.conf - is "group = www-data". I checked my php-fpm.conf and noticed that the PID file is being created at /var/run/php5-fpm.pid so I changed that. Then Monit said "Initializing" followed by "Connection failed". Any suggestions?










      share|improve this question














      System: LEMP running on Ubuntu 14.04



      I'm trying to configure the tool Monit to restart Nginx or PHP-FPM if ever there is a problem. It is correctly monitoring Nginx however under status for PHP-FPM it says "Not Monitoring". Apparently I'm having it check the wrong location.



      Here is my Nginx configuration for PHP-FPM that is running on a socket:



      location ~ .php$ ## Execute PHP scripts
      if (!-e $request_filename) rewrite / /index.php last; ## Catch 404s that try_files miss

      expires off; ## Do not cache dynamic content
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params; ## See /etc/nginx/fastcgi_params

      fastcgi_keep_conn on; #hhvm param



      Here is my Monit configuration for both Nginx and PHP-FPM:



      ## Check Nginx
      check process nginx with pidfile /var/run/nginx.pid
      start program = "/etc/init.d/nginx start"
      stop program = "/etc/init.d/nginx stop"
      ## Check PHP-FPM
      check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
      group www-data #change accordingly
      start program = "/etc/init.d/php5-fpm start"
      stop program = "/etc/init.d/php5-fpm stop"
      if failed unixsocket /var/run/php-fpm/php-fpm.sock then restart
      if 3 restarts within 5 cycles then timeout


      I went with the suggested start and stop recommendations despite always restarting with "service php5-fpm restart".



      My group - according to /etc/php5/fpm/pool.d/www.conf - is "group = www-data". I checked my php-fpm.conf and noticed that the PID file is being created at /var/run/php5-fpm.pid so I changed that. Then Monit said "Initializing" followed by "Connection failed". Any suggestions?







      ubuntu nginx monitoring php-fpm monit






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 4 '14 at 16:29









      sparecyclesparecycle

      3071415




      3071415




















          2 Answers
          2






          active

          oldest

          votes


















          0














          Ok, I was able to solve it myself. There were a number of problems. "php5" needed to replace almost every instance of "php". The bad connection I was receiving was referring to the unixsocket so I had to update that as well. Also the new PID location changed it looks like with PHP5-FPM. Here is the final configuration.



          ## Check PHP-FPM
          check process php5-fpm with pidfile /var/run/php5-fpm.pid
          group www-data #change accordingly
          start program = "/etc/init.d/php5-fpm start"
          stop program = "/etc/init.d/php5-fpm stop"
          if failed unixsocket /var/run/php5-fpm.sock then restart
          if 3 restarts within 5 cycles then timeout





          share|improve this answer
































            0














            This is the configuration I've been using for a long time and works great



            check process php5-fpm with pidfile /var/run/php5-fpm.pid
            group phpcgi
            if not exist for 2 cycles then restart
            start program = "/usr/sbin/service php5-fpm start"
            stop program = "/usr/sbin/service php5-fpm stop"
            if not exist for 2 cycles then restart
            if failed unixsocket /var/run/php5-fpm.sock then restart
            if 5 restarts within 5 cycles then timeout





            share|improve this answer























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "2"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f649213%2fconfigure-monit-to-monitor-php5-fpm-on-ubuntu-nginx-setup%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Ok, I was able to solve it myself. There were a number of problems. "php5" needed to replace almost every instance of "php". The bad connection I was receiving was referring to the unixsocket so I had to update that as well. Also the new PID location changed it looks like with PHP5-FPM. Here is the final configuration.



              ## Check PHP-FPM
              check process php5-fpm with pidfile /var/run/php5-fpm.pid
              group www-data #change accordingly
              start program = "/etc/init.d/php5-fpm start"
              stop program = "/etc/init.d/php5-fpm stop"
              if failed unixsocket /var/run/php5-fpm.sock then restart
              if 3 restarts within 5 cycles then timeout





              share|improve this answer





























                0














                Ok, I was able to solve it myself. There were a number of problems. "php5" needed to replace almost every instance of "php". The bad connection I was receiving was referring to the unixsocket so I had to update that as well. Also the new PID location changed it looks like with PHP5-FPM. Here is the final configuration.



                ## Check PHP-FPM
                check process php5-fpm with pidfile /var/run/php5-fpm.pid
                group www-data #change accordingly
                start program = "/etc/init.d/php5-fpm start"
                stop program = "/etc/init.d/php5-fpm stop"
                if failed unixsocket /var/run/php5-fpm.sock then restart
                if 3 restarts within 5 cycles then timeout





                share|improve this answer



























                  0












                  0








                  0







                  Ok, I was able to solve it myself. There were a number of problems. "php5" needed to replace almost every instance of "php". The bad connection I was receiving was referring to the unixsocket so I had to update that as well. Also the new PID location changed it looks like with PHP5-FPM. Here is the final configuration.



                  ## Check PHP-FPM
                  check process php5-fpm with pidfile /var/run/php5-fpm.pid
                  group www-data #change accordingly
                  start program = "/etc/init.d/php5-fpm start"
                  stop program = "/etc/init.d/php5-fpm stop"
                  if failed unixsocket /var/run/php5-fpm.sock then restart
                  if 3 restarts within 5 cycles then timeout





                  share|improve this answer















                  Ok, I was able to solve it myself. There were a number of problems. "php5" needed to replace almost every instance of "php". The bad connection I was receiving was referring to the unixsocket so I had to update that as well. Also the new PID location changed it looks like with PHP5-FPM. Here is the final configuration.



                  ## Check PHP-FPM
                  check process php5-fpm with pidfile /var/run/php5-fpm.pid
                  group www-data #change accordingly
                  start program = "/etc/init.d/php5-fpm start"
                  stop program = "/etc/init.d/php5-fpm stop"
                  if failed unixsocket /var/run/php5-fpm.sock then restart
                  if 3 restarts within 5 cycles then timeout






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 4 '14 at 17:02

























                  answered Dec 4 '14 at 16:41









                  sparecyclesparecycle

                  3071415




                  3071415























                      0














                      This is the configuration I've been using for a long time and works great



                      check process php5-fpm with pidfile /var/run/php5-fpm.pid
                      group phpcgi
                      if not exist for 2 cycles then restart
                      start program = "/usr/sbin/service php5-fpm start"
                      stop program = "/usr/sbin/service php5-fpm stop"
                      if not exist for 2 cycles then restart
                      if failed unixsocket /var/run/php5-fpm.sock then restart
                      if 5 restarts within 5 cycles then timeout





                      share|improve this answer



























                        0














                        This is the configuration I've been using for a long time and works great



                        check process php5-fpm with pidfile /var/run/php5-fpm.pid
                        group phpcgi
                        if not exist for 2 cycles then restart
                        start program = "/usr/sbin/service php5-fpm start"
                        stop program = "/usr/sbin/service php5-fpm stop"
                        if not exist for 2 cycles then restart
                        if failed unixsocket /var/run/php5-fpm.sock then restart
                        if 5 restarts within 5 cycles then timeout





                        share|improve this answer

























                          0












                          0








                          0







                          This is the configuration I've been using for a long time and works great



                          check process php5-fpm with pidfile /var/run/php5-fpm.pid
                          group phpcgi
                          if not exist for 2 cycles then restart
                          start program = "/usr/sbin/service php5-fpm start"
                          stop program = "/usr/sbin/service php5-fpm stop"
                          if not exist for 2 cycles then restart
                          if failed unixsocket /var/run/php5-fpm.sock then restart
                          if 5 restarts within 5 cycles then timeout





                          share|improve this answer













                          This is the configuration I've been using for a long time and works great



                          check process php5-fpm with pidfile /var/run/php5-fpm.pid
                          group phpcgi
                          if not exist for 2 cycles then restart
                          start program = "/usr/sbin/service php5-fpm start"
                          stop program = "/usr/sbin/service php5-fpm stop"
                          if not exist for 2 cycles then restart
                          if failed unixsocket /var/run/php5-fpm.sock then restart
                          if 5 restarts within 5 cycles then timeout






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 1 '16 at 13:45









                          Pian0_M4nPian0_M4n

                          15015




                          15015



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Server Fault!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f649213%2fconfigure-monit-to-monitor-php5-fpm-on-ubuntu-nginx-setup%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              VokA7NDhu zfCBUDssCvIVNkuAVarvSOwzqDu
                              BrsVX3nsZV3Ay8A9shd6,m6hbS,W5EMzS s3H4rLP04mTfAx2U,Bj,vTq9

                              Popular posts from this blog

                              RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

                              Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                              Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020