Plesk

How to configure the PHP-FPM plugin of 360 Monitoring on a Plesk server?

Question

How to configure the PHP-FPM plugin of 360 Monitoring on a Plesk server?

Answer

Note: All domains with the PHP-FPM plugin enabled must:
- have a valid SSL certificate
- be accessible (i.e. have correct DNS records, not blocked by a firewall, etc.)

For a single domain on Nginx (manually)

  1. Log into Plesk

  2. Go to Domains > example.com > PHP Settings

  3. Add the following lines to the Additional directives field:

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

  4. Click OK

  5. Go to Domains > example.com > Apache & nginx Settings

  6. Add the following lines to the 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;
    }

  7. Click OK

  8. Connect to the server via SSH

  9. Add the following section to the file /etc/agent360.ini:

    [phpfpm]
    enabled = yes
    status_page_url = https://example.com/status_phpfpm?json

  10. Restart the service:

    # systemctl restart agent360


Note: It is needed to repeat the steps for every domain that is needed to be monitored. For multiple domains, the section in /etc/agent360.ini should look like this one:

[phpfpm]
enabled = yes
status_page_url = https://example.com/status_phpfpm?json, https://domain.tld/status_phpfpm?json, ...

For a single domain on Apache (manually)

  1. Log into Plesk

  2. Go to Domains > example.com > PHP Settings

  3. Add the following lines to the Additional directives field:

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

  4. Click OK

  5. Go to Domains > example.com > Apache & nginx Settings

  6. Add the following lines to the 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>

  7. Click OK

  8. Connect to the server via SSH

  9. Add the following section to the file /etc/agent360.ini:

    [phpfpm]
    enabled = yes
    status_page_url = https://example.com/status_phpfpm?json

  10. Restart the service:

    # systemctl restart agent360


Note: It is needed to repeat the steps for every domain that is needed to be monitored. For multiple domains, the section in /etc/agent360.ini should look like this one:

[phpfpm]
enabled = yes
status_page_url = https://example.com/status_phpfpm?json, https://domain.tld/status_phpfpm?json, ...


Warning: Changes in the templates might result…