• 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 apache crashes and can't restart with systemctl restart httpd

yehudigt

Basic Pleskian
It often happens that apache crashes and nginx shows a Bad gateway error.
The problem is that if I input "systemctl restart httpd" it shows no error message, everything seems like apache has restarted, but the bad gateway error persists.
The only way I can fix this is by rebooting the server or by modifying the site php properties from php-fpm + apache to fastcgi + apache.
My server is a centos 7 linux with plesk 12.5.30
As I have monit installed to monitor the apache process this problem causes that monit is uanble to avoid the server from being unavailable.

Can anybody help me unserstanding what to restart in order to have apache back up again and avoid the bad gateway error?
 
Hi yehudigt,

is there a reason, why you desire help without any log - entries from your apache - logs? The amount of possible reasons and root causes are enormous and your thread post only leads to guessings, which is mostly only time-consuming. Pls. post relevant entries from your logs, if you need help with your investigations.


Sometimes, it is as well a good idea to change the log - level ( TEMPORARILY! ), to get more informations in Plesk - log - files:



Pls. note as well, that increasing log - levels can help to investigate issues/errors/problems and root causes. Pls. inspect your configuration files, to inform us about the current used log - levels and don't forget: The more facts your provide, the better will be suggestions, solutions and work-arounds from people willing to help you. ;)
 
Thank you for your advice. Essentially I posted no logs because at this very moment I'm not investigating why apache crashed. I just want to know how to restart it in order to avoid down times. After this I will invesdtigate why apache crashes, so I was wondering that a Plesk expert may know what's the difference between restarting apache and switching the site php properties from php-fpm + apache to fastcgi + apache. Performing this last operation brings back up apache, so this may lead to a solution.
 
Hi yehudigt,

what's the difference between restarting apache and switching the site php properties from php-fpm + apache to fastcgi + apache.
Well, the "normal" restart doesn't change any webserver configuration files, while switching PHP - handlers leads to a reconfiguration with new/different modules/directives in the depending, domain specific configuration file. But such an information doesn't lead to investigations, without inspecting your log - files, it only leads to guessings, what the reason might be, that the "normal" apache - restart - command could not finish as expected.

Performing this last operation brings back up apache, so this may lead to a solution.
I doubt that, because as already stated, you don't investigate the root cause, you just assume, that there could be a root cause. Such guessing games could be nice, but from my point of view, they are only time consuming and useless. I thought that you want to solve your issue/error/problem instead of playing lottery. :p:D
 
It is probably not Apache that crashes, it is the PHP FPM service. We are experiencing this, too, but have a narrow grid surveillance that detects the case and restarts PHP-FPM service, then restarts httpd gracefully. I think that there is no suitable fix for the symptoms at this time. PHP FPM is giving lots of headaches. Preemptive service restarts of the plesk-php56-fpm, plesk-php70-fpm and plesk-php71-fpm services and higher values for max_children can ease the situation, but service crashes will continue for seemingly no reason.
 
Back
Top