• 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

Resolved mod_fcgid cause apache not restarting

EmilioO

Basic Pleskian
Hello my apache server is shutting down every day at 6:52 (probably by cron.daily process 50saupdate)

I've to restart apache2 manually after that.

My system:
  • OS: Ubuntu 16.04
  • Plesk: Onyx 17.5.3 Update 4
  • mod_fcgid: libapache2-mod-fcgid-psa 2.3.9.5-ubuntu16.04.17031614
Error in /var/log/apache2/error.log

Code:
[Fri May 05 20:06:43.008634 2017] [fcgid:emerg] [pid 30941:tid 140173595944832] (9)Bad file descriptor: mod_fcgid: Can't lock process table for initialization
[Fri May 05 20:06:43.008788 2017] [:notice] [pid 308:tid 140173595944832] FastCGI: process manager initialized (pid 308)
[Fri May 05 20:06:43.010629 2017] [:alert] [pid 308:tid 140173595944832] FastCGI: read() from pipe failed (0)
[Fri May 05 20:06:43.010642 2017] [:alert] [pid 308:tid 140173595944832] FastCGI: the PM is shutting down, Apache seems to have disappeared - bye

I can reproduce by executing "plesk repair installation"

I've reinstalled (purging) libapache2-mod-fcgid-psa, also update the timeout limit:
/etc/apache2/mods-enabled/fcgid.conf

Code:
<IfModule mod_fcgid.c>

<IfModule !mod_fastcgi.c>
    AddHandler fcgid-script fcg fcgi fpl
</IfModule>

  FcgidIPCDir /var/lib/apache2/fcgid/sock
  FcgidProcessTableFile /var/lib/apache2/fcgid/shm

  FcgidIdleTimeout 300
  FcgidProcessLifeTime 300
  FcgidMaxProcesses 20
  FcgidMaxProcessesPerClass 8
  FcgidMinProcessesPerClass 0
  FcgidConnectTimeout 30
  FcgidIOTimeout 300
  FcgidInitialEnv RAILS_ENV production
  FcgidIdleScanInterval 10

</IfModule>

I've found this KB but I'have latest psa version installed.

Thanks in advance.
 
Hi EmilioO,

first, pls. check your logrotation files for an apache2/httpd "reload" command, with for example:
Code:
find /etc/logrotate.d -exec grep --color -Hni "reload" {} \;
... and change each apache2/httpd "reload" - command with "restart"

Second, pls. increase your "Apache restart interval" to something which is at least "60" seconds" at => HOME > Tools & Settings > Apache Web Server Settings

... and third, pls. don't use "MPM-EVENT", but rather "MPM-PREFORK", to avoid known issues when you use "MPM-EVENT" with the "mod_php", "FastCGI" or "PHP-FPM". Again, this can be changed over the Plesk Control Panel: => HOME > Tools & Settings > Apache Web Server Settings
 
Changing Apache to MPM-PREFORK do the trick..

Notice that "plesk repair installation" command revert apache config to MPM EVENT.

Thanks !
 
Back
Top