9

機能するphp-fpmのmonit構成を見つけるのに苦労しています。

これは私が試したことです:

### Monitoring php-fpm: the parent process.
check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
  group phpcgi # phpcgi group
  start program = "/etc/init.d/php-fpm start"
  stop program  = "/etc/init.d/php-fpm stop"
  ## Test the UNIX socket. Restart if down.
  if failed unixsocket /var/run/php-fpm.sock then restart
  ## If the restarts attempts fail then alert.
  if 3 restarts within 5 cycles then timeout

しかし、 php-fpm.sockがないため失敗します(Centos 6)

4

6 に答える 6

14

Centos 6でこの問題を抱えている他の人のために、php-fpmソケットは/var/run/php-fpm/php-fpm.sock

したがって、最終的な構成は次のようになります。

check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
  group phpcgi #change accordingly
  start program = "/etc/init.d/php-fpm start"
  stop program  = "/etc/init.d/php-fpm stop"
  if failed unixsocket /var/run/php-fpm/php-fpm.sock then restart
  if 3 restarts within 5 cycles then timeout
于 2012-06-19T10:47:35.917 に答える
4

それ以外の:

if failed unixsocket /var/run/php-fpm.sock then restart

あなたが試すことができます:

if failed port 9000 type TCP then restart

場合のように lighttpd/nginx 構成を編集する必要はありませんlocation /ping

/etc/monit/conf.d/php-fpm.confのUbuntuは次のようになります。

check process php-fpm with pidfile /var/run/php5-fpm.pid
  stop program = "/sbin/start-stop-daemon --stop --pidfile /var/run/php5-fpm.pid"
  start program  = "/sbin/start-stop-daemon --start --pidfile /var/run/php5-fpm.pid --exec /usr/sbin/php5-fpm"
  if failed port 9000 type TCP then restart
于 2012-06-18T08:23:43.403 に答える
3

php-fpm で ping.path ディレクティブを使用して、動作しているかどうかを確認しています...

nginx.confで構成しました(セットアップかどうかはわかりません)

location /ping {
    access_log     off;
    allow          127.0.0.1;
    deny           all;
    root           html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
    include        fastcgi_params;
}
于 2011-10-26T22:53:10.623 に答える