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

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







                              Popular posts from this blog

                              Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                              Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                              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