系統PHP5-FPM:在Ubuntu 14.04運行LEMP配置monit的監控在Ubuntu/Nginx的設置
我想配置工具monit的重啓Nginx的或PHP-FPM如果曾經有一個問題。它正確地監測Nginx,但Monit說它將「不監視」。顯然我正在檢查錯誤的位置。
下面是這是一個插座上運行PHP-FPM我的Nginx的配置:
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
}
這裏是兩個的Nginx和PHP-FPM我monit的配置:
## 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
我去儘管始終以「service php5-fpm restart」重新啓動,建議的啓動和停止建議。
我的組 - 根據/etc/php5/fpm/pool.d/www.conf是「group = www-data」。有什麼建議麼?
我發現問題的一部分。原來,我的PID文件實際上已配置(默認爲Ubuntu)位於/var/run/php5-fpm.pid。現在它說「初始化」 – sparecycle 2014-12-04 16:25:51