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;
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
add a comment |
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
add a comment |
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
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
ubuntu nginx monitoring php-fpm monit
asked Dec 4 '14 at 16:29
sparecyclesparecycle
3071415
3071415
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
edited Dec 4 '14 at 17:02
answered Dec 4 '14 at 16:41
sparecyclesparecycle
3071415
3071415
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Sep 1 '16 at 13:45
Pian0_M4nPian0_M4n
15015
15015
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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