Question
How to configure 360 Monitoring's PHP-FPM plugin on Plesk?
Answer
All domains with the PHP-FPM plugin enabled must have a valid certificate and be publicly accessible on the internet.
-
Go to Domains > example.com > PHP
-
Add the following to Additional directives and press OK to enable the status page
[php-fpm-pool-settings]
pm.status_path = /status_phpfpm -
Go to Domains > example.com > Apache & nginx
Note: Replace example.com in the following examples with the actual domain
-
For websites served by nginx, add the following to Additional directives for nginx
location ~ ^/status_phpfpm$ {
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass "unix:///var/www/vhosts/system/example.com/php-fpm.sock";
include /etc/nginx/fastcgi.conf;
} -
For sites served by Apache, add the following to Additional directives for HTTPS
<LocationMatch "/status_phpfpm">
ProxyPass unix:///var/www/vhosts/system/example.com/php-fpm.sock|fcgi://127.0.0.1:9000
</LocationMatch>
-
-
Connect to the server via SSH
-
Add the PHP-FPM section to
/etc/agent360-custom.ini
Note: Replace example.com in the following example with the actual domain
[phpfpm]
enabled = yes
status_page_url = https://example.com/status_phpfpm?json -
Restart the service to apply the changes
# systemctl restart agent360
Repeat the steps for every domain that needs to be monitored, and use this syntax in /etc/agent360-custom.ini
for multiple domains:
[phpfpm]
enabled = yes
status_page_url = https://example.com/status_phpfpm?json, https://example2.com/status_phpfpm?json
EXTPLESK-3359 was created to discuss automatic implementation of this plugin.
Comments
2 comments
Hi, I have followed the section "For a single domain on Apache (manually)". Everything works well and the status page show me realtime stats about PHP-FPM service! But 360Monitoring cannot access the page which is public. here is the error i got when i execute this command (found in the 360Monitoring documentation):
How can I resolve this issue? Thank you!
I know it is a late reply, but we had the same problem.
Our solution was to add all of our webservers (public) IPs to the LocationMatch:
<LocationMatch "/status_phpfpm">
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from xxx.xxx.xxx.xxx
Allow from xxxx:xxxx:x:xxx::xx
ProxyPass unix:///var/www/vhosts/system/domain.tld/php-fpm.sock|fcgi://127.0.0.1:9000
</LocationMatch>
Cheers,
Patrick
Please sign in to leave a comment.