2017-03-09 32 views
1

我试图启用在Plesk 17下运行的虚拟主机上的PHP-FPM状态页面,使用apache为PHP文件提供服务,但以nginx作为代理。 我已启用php的状态页面,但我遇到了nginx规则的问题。这里是我的另外nginx的指令,到目前为止Plesk + NGINX代理上的PHP-FPM状态页面

location /fpm-status { 
    include fastcgi.conf; 
    fastcgi_pass unix:/var/www/vhosts/system/fifthelement.gr/php-fpm.sock; 
    access_log off; 
    allow all; 
} 

然而,这(和其他一些指令,我想太)似乎并没有工作,因为我得到一个“找不到文件”的错误,而来访的状态页。

有没有人设法做到这一点?

谢谢!

回答

3

status-page期望apache2的端口80/443,但是与Plesk结合使用时,您的apache2-web服务器会侦听端口80/443上的端口7080/7081和nginx。

请注意。例如使用

<IfModule mod_status.c> 
 
\t Listen 8005 
 
<Location /apache-status> 
 
\t SetHandler server-status 
 
\t Order deny,allow 
 
\t Deny from all 
 
\t Allow from 127.0.0.1 ::1 
 
</Location> 
 
\t ExtendedStatus On 
 
</IfModule>

您的server.conf中,httpd.conf文件里面并从您的SSH调用的页面 - 用如 “山猫”

lynx http://localhost:8005/apache-status
命令行

对于你的PHP FPM的状态页,请。找到相应的“fifthelement.gr.conf”(在您的域中使用来自供应商的标准PHP5 - Handler的示例:“/etc/php5/fpm/pool.d/fifthelement.gr.conf”)并定义内部:

pm.status_path = /fpm-status 

之后,修改你的额外nginx的指令,例如:

location /fpm-status { 
 
\t include fastcgi.conf; 
 
\t allow 127.0.0.1; 
 
\t deny all; 
 
\t fastcgi_pass unix:/var/www/vhosts/system/fifthelement.gr/php-fpm.sock; 
 
\t access_log off; 
 
\t }

...又一次,你可以使用 “猞猁” 与范例 - 命令:

lynx http://localhost/fpm-status

+0

不幸的是,你的解决方案适用于Apache的状态页面(这我已经启用),而不是为PHP -FPM状态页面。 –

+0

我按照以前的建议编辑过。 PLS。报告你的测试结果。 :-) – UFHH01

+0

我取得了部分成功,我可以看到该页面,但我得到的只是一个“未找到文件”。错误。套接字文件在那里,我也与其他人一起检查......我的日志文件写道:“读取来自上游的响应标头时,在stderr中发送FastCGI:”主脚本未知“”' –

0

我下面的作品在CentOS 7(使用PLESK 17内的Plesk>网站&站点> [yourdomainname ]>虚拟主机设置我有:运行PHP作为FPM应用nginx的)担任

步骤获得工作/状态页

  1. 创建/编辑/var/www/vhosts/system/[yourdomainname]/conf/php.ini加入以下

    [php-fpm-pool-settings] 
    pm.status_path = /status 
    
  2. 内部的Plesk>网站&站点> [yourdomainname]>阿帕奇& nginx的设置添加到附加nginx的指令以下

    location ~ ^/status$ { 
        allow 127.0.0.1; 
        allow [yourip]; 
        deny all; 
        fastcgi_split_path_info ^((?U).+\\.php)(/?.+)$; 
        fastcgi_param PATH_INFO $fastcgi_path_info; 
        fastcgi_pass "unix:///var/www/vhosts/system/[yourdomainname]/php-fpm.sock"; 
        include /etc/nginx/fastcgi.conf; 
    } 
    
  3. 刷新的Plesk PHP配置

    /usr/local/psa/bin/php_settings -u 
    

那么你应该能够访问​​和http://[yourdomainname]/status?full