• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue FPM application server by apache stopped working

sebas

Basic Pleskian
Hi,

Somehow today all the websites that were configured as FPM application server by apache stopped working they were working last night, they are not working today.

Switching to FPM application served by nginx get the site back up.

I don't understand what happened and I don't understand how to get FPM application server by apache working again.

Apache is running:

● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.d
└─limit_nofile.conf
Active: active (running) since Mon 2019-11-25 02:05:40 CST; 5min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 3466 (httpd)
Status: "Total requests: 2; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─3466 /usr/sbin/httpd -DFOREGROUND
├─3928 /usr/local/psa/admin/sbin/pipelog 7081
├─3995 /usr/sbin/httpd -DFOREGROUND
├─4044 /usr/sbin/httpd -DFOREGROUND
├─4047 /usr/sbin/httpd -DFOREGROUND
├─4049 /usr/sbin/httpd -DFOREGROUND
├─4050 /usr/sbin/httpd -DFOREGROUND
└─4054 /usr/sbin/httpd -DFOREGROUND

Nov 25 02:05:38 cortazar.iac.com.mx systemd[1]: Starting The Apache HTTP Server...
Nov 25 02:05:40 cortazar.iac.com.mx systemd[1]: Started The Apache HTTP Server.

Also php-fpm is running:
2115 ? Ss 0:01 php-fpm: master process (/opt/plesk/php/5.6/etc/php-fpm.conf)
2120 ? Ss 0:04 php-fpm: master process (/opt/plesk/php/7.3/etc/php-fpm.conf)
24764 ? S 0:00 \_ php-fpm: pool xxxxsss.com
2127 ? Ss 0:01 php-fpm: master process (/opt/plesk/php/7.2/etc/php-fpm.conf)

What I get on the website is
502 Bad Gateway

If I try:
http://ip.ip.ip.ip:7080/
https://ip.ip.ip.ip:7081/

That is working and it is served by apache.

Is there a way to switch from FPM application server by apache to FPM application served by nginx from the command line? I've been using

plesk bin domain --help

trying to find a way but I've been unlucky so far.

Thanks for your help,
 
Hi,

I'm not sure how to switch from FPM application server by apache to FPM application served by nginx from the command line.

You can try,

Restart both Apache and Nginx.

#service httpd restart
#service nginx restart

Check the status,

#service httpd status
#service nginx status

If the services are running without any issues,

#plesk repair web YourDomainName , this will regenerate the configuration files.
 
I'd like to add something to the suggestion. The PHP-FPM service sometimes fails and needs to be restarted. It is normally not sufficient to restart the web server, because the PHP-FPM service will still hang. So you will also need to restart
# service plesk-php56-fpm restart
# service plesk-php70-fpm restart
# service plesk-php71-fpm restart
# service plesk-php73-fpm restart
(depending on which PHP version is affected)

Unless you have your own surveillance for service activities, I suggest to use the Plesk watchdog extension to auto-restart services on failures.
 
Well, it is working again, but I did nothing, so I don't know what is causing it or how to solve it.
 
And again it stopped working.

capture_001_25112019_222647.jpg

Did a restart for the PHP-FPM available.

Made no difference.
 
I suggest to use the Plesk watchdog extension to auto-restart services on failures.
Besides that, to lower the frequency of outages, you can
- increase pm.max_children to a number between 15 an 25
- increase pm.max_requests to a high number, e.g. 10000
 
Wait, but if the server does answer when connecting the apache ports directly (I thought apache binds only to localhost?), doesn't that mean apache and php-fpm are running normally, and there's something wrong with nginx' forwarding? php-fpm failing should IMO produce a Gateway Timeout, not a Bad Gateway.
 
I'd like to add something to the suggestion. The PHP-FPM service sometimes fails and needs to be restarted. It is normally not sufficient to restart the web server, because the PHP-FPM service will still hang. So you will also need to restart
# service plesk-php56-fpm restart
# service plesk-php70-fpm restart
# service plesk-php71-fpm restart
# service plesk-php73-fpm restart
(depending on which PHP version is affected)

Unless you have your own surveillance for service activities, I suggest to use the Plesk watchdog extension to auto-restart services on failures.
How to use Plesk watchdog ext to auto-restart services?
 
Back
Top