2014-12-04 3 views
2

시스템에 PHP5-FPM을 모니터링 : LEMP는 내가 문제가있는 경우 Nginx에 나 PHP-FPM를 다시 시작하는 도구 MONIT를 구성하기 위해 노력하고있어구성 MONIT 우분투/Nginx에 설치

우분투 14.04에서 실행. Monit은 Nginx를 올바르게 모니터링하지만 모니터하지 않을 것이라고 말합니다. 분명히 내가 틀린 위치를 확인하는 중이 야. 내가 갔다

## 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 

: 여기

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 구성입니다 : 여기

소켓에서 실행되는 PHP-FPM 내 Nginx의 구성입니다 제안 된 시작 및 중지 권장 사항은 항상 "service php5-fpm restart"로 다시 시작되지만.

내 그룹 - /etc/php5/fpm/pool.d/www.conf에 따르면 "group = www-data"입니다. 어떤 제안?

+0

이 문제의 일부를 발견했습니다. 내 PID 파일이 실제로 /var/run/php5-fpm.pid에 위치하도록 (기본적으로 Ubuntu의 경우) 구성되었습니다. 이제는 "초기화 중" – sparecycle

답변

4

좋아, 직접 해결할 수있었습니다. 여러 가지 문제가있었습니다. "php5"는 "php"의 거의 모든 인스턴스를 대체해야했습니다. 내가받은 잘못된 연결은 unixsocket을 가리키는 것이므로 업데이트해야했습니다. 또한 새로운 PID 위치가 PHP5-FPM과 비슷하게 변경되었습니다. 다음은 최종 구성입니다.

## 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 
+1

일이 잘되어 있습니다. 이전 질문에 대한 답변이 구형이었습니다. – Kash

+0

고마워, 나는 또한 그 것으로 나타났습니다. – sparecycle