Articles in this section

How to configure 360 Monitoring's PHP-FPM plugin on Plesk?

kb: bug Plesk360 Platform360

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.

  1. Log into Plesk

  2. Go to Domains > example.com > PHP

  3. Add the following to Additional directives and press OK to enable the status page

    [php-fpm-pool-settings]
    pm.status_path = /status_phpfpm

  4. 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>

  5. Connect to the server via SSH

  6. 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

  7. 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.

Was this article helpful?

Comments

3 comments
Date Votes
  • 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

    0
  • Are there easier steps to do this? We have too many domains to manually do this by hand

    0
  • This exposes status page to the public access. 

    0

Please sign in to leave a comment.