加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – PHP-FPM,Monit,ping / status页面,Apache

发布时间:2020-12-13 23:56:52 所属栏目:Linux 来源:网络整理
导读:我试图用Monit监视我的FPM守护进程,我假设由于重生和PID改变,以下不是最好的技术? check process php5-fpm with pidfile "/var/run/php5-fpm.pid" start = "/etc/init.d/php5-fpm start" stop = "/etc/init.d/php5-fpm stop" if failed port 80 protocol ht
我试图用Monit监视我的FPM守护进程,我假设由于重生和PID改变,以下不是最好的技术?

check process php5-fpm with pidfile "/var/run/php5-fpm.pid"
    start = "/etc/init.d/php5-fpm start"
    stop = "/etc/init.d/php5-fpm stop"
    if failed port 80 protocol http then restart

从我可以收集的内容来看,更好的方法是使用FPM ping URL,但我无法使用Apache激活它们.

除了设置FPM池选项之外,Apache / PHP-FPM中究竟需要做什么:

pm.status_path = / status
ping.path = / ping

我希望能让我简单地去:

http://mydomain.com/status

拉起状态页面.当我转到此URL时,我收到404错误.我假设我需要某种处理程序来重定向/ status和/ ping到我的本地主机端口9000上的FPM服务器.我该怎么做?

解决方法

您需要在apache(000-default ???)中设置默认vhost来处理/ status和/ ping.我使用nginx(道歉,但根据需要进行调整),我的默认文件具有以下位置指令:

location ~ ^/(status|ping)${
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
    allow 127.0.0.1;
    deny all;
}

然后,这允许我卷曲localhost / status.

您还需要更改您的php-fpm conf(我的是www.conf)并取消注释行:

pm.status_path = /status
ping.path = /ping

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读