简体   繁体   English

Plesk + NGINX代理上的PHP-FPM状态页面

[英]PHP-FPM status page on Plesk + NGINX proxy

I am trying to enable the PHP-FPM status page on a vhost running under Plesk 17 using apache to serve PHP files, but with nginx as a proxy. 我试图在Plesk 17下运行的vhost上启用PHP-FPM状态页面,使用apache来提供PHP文件,但是使用nginx作为代理。 I have enabled the status page for php, but I am having trouble with the nginx rules. 我已启用php的状态页面,但我遇到了nginx规则的问题。 Here is my additional nginx directives so far 到目前为止,这是我的附加nginx指令

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

However, this (and some other directives I tried too) does not seem to work since I am getting a "File not found" error while visiting the status page. 但是,这个(以及我尝试的其他一些指令)似乎不起作用,因为我在访问状态页面时遇到“找不到文件”错误。

Has anyone managed to do this? 有没有人设法做到这一点?

Thanks! 谢谢!

the status-page expects the ports 80/443 for apache2, but in combination with Plesk, your apache2 - webserver listens on the ports 7080/7081 and nginx on the ports 80/443. 状态页面需要端口80/443用于apache2,但与Plesk结合使用时,您的apache2 - webserver将侦听端口80/643上的端口7080/7081和nginx。

Pls. PLS。 use for example 用例如

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

inside your server.conf, httpd.conf and call the page from your SSH - command line with for example "lynx" 在您的server.conf,httpd.conf中并从您的SSH命令行调用页面,例如“lynx”

 lynx http://localhost:8005/apache-status 

For your PHP-FPM - status - page, pls. 对于您的PHP-FPM - 状态 - 页面,请。 locate the corresponding "fifthelement.gr.conf" ( example for the usage of the standart PHP5 - Handler from your vendor on your domain: "/etc/php5/fpm/pool.d/fifthelement.gr.conf" ) and define inside: 找到相应的“fifthelement.gr.conf”(使用您所在域的供应商提供的标准PHP5 - Handler的示例:“/ etc / php5 / fpm / pool.d / fifthelement.gr.conf”)并在里面定义:

pm.status_path = /fpm-status

Afterwards, modify your additional nginx directive to for example: 然后,修改您的附加nginx指令,例如:

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

... and again, you might use "lynx" with the example - command: ...再次,您可以使用“lynx”与示例 - 命令:

 lynx http://localhost/fpm-status 

The following works for me using PLESK 17 on CentOS 7 (inside Plesk > Websites & Domains > [yourdomainname] > Hosting Settings I have: run PHP as FPM application served by nginx ) 以下适用于我在CentOS 7上使用PLESK 17(在Plesk>网站与域名> [您的域名]>主机设置我有:运行PHP作为由nginx提供的FPM应用程序

Steps to get a working /status page 获取工作/状态页面的步骤

  1. Create/edit /var/www/vhosts/system/[yourdomainname]/conf/php.ini adding the following 创建/编辑/var/www/vhosts/system/[yourdomainname]/conf/php.ini添加以下内容

     [php-fpm-pool-settings] pm.status_path = /status 
  2. Inside Plesk > Websites & Domains > [yourdomainname] > Apache & nginx Settings add to Additional nginx directives the following Plesk内部>网站与域名> [yourdomainname]> Apache&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. Reload Plesk PHP configuration 重新加载Plesk PHP配置

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

Then you should be able to access http://[yourdomainname]/status and http://[yourdomainname]/status?full 然后你应该能够访问http:// [yourdomainname] / statushttp:// [yourdomainname] / status?full

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM