• 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 Apache and Nginx randomly killed

Olaf Kapinski

New Pleskian
Hi all
I receive random mails from the Watchdog, that Apache or Nginx have been restarted. That cause an outage of the Websites of 5 Minutes. Any Idea, how to avoid this?

It's the latest Plesk on Ubuntu 18.04, ModSecurity and Fail2ban are set up. I don't even see the reason for the crashes, has no corellation with the strange Memory-Load I see on Apache.

Thanks a lot!
OLAF
 
Hi all
I receive random mails from the Watchdog, that Apache or Nginx have been restarted. That cause an outage of the Websites of 5 Minutes. Any Idea, how to avoid this?

It's the latest Plesk on Ubuntu 18.04, ModSecurity and Fail2ban are set up. I don't even see the reason for the crashes, has no corellation with the strange Memory-Load I see on Apache.

Thanks a lot!
OLAF

Hello Olaf Kapinski,

Can you attach the report?
 
Hi all
I receive random mails from the Watchdog, that Apache or Nginx have been restarted. That cause an outage of the Websites of 5 Minutes. Any Idea, how to avoid this?

It's the latest Plesk on Ubuntu 18.04, ModSecurity and Fail2ban are set up. I don't even see the reason for the crashes, has no corellation with the strange Memory-Load I see on Apache.

Thanks a lot!
OLAF

@Olaf Kapinski

I suppose that you have some timeout issues on one or more domains, causing Apache to hang, with the hanging Apache causing Nginx to malfunction.

First of all, try to find the problematic domains (if any) and increase the values for max_execution_time and max_input_time via the Plesk Panel.

Second, verify that the file /etc/nginx/conf.d exists and contains

proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

or values higher than that.

Note that it is not recommended to increase the before mentioned values too much, since that could cause undesired results: for instance, Nginx will be waiting for Apache responses, even if Apache is down.

Third, try to run some tests by overloading the server: for example, upload a huge file or do some ab testing.

If the before mentioned tests do not yield alarming results, then the actions in step 1 (see first point) were probably sufficient for now and the near future.

If you still have problems with Apache and Nginx restarting randomly, then you can enter directives for proxy buffering or proxy caching in the Nginx configuration.

Note that it is recommended to start with proxy caching: not only will you (partially) isolate issues at the Apache level from those on the Nginx level (read: if proxy caching is enabled and the current problem persists, then you are almost certain that the root cause of the problem is to be found at the Apache level, since Nginx simply would serve put a non-cached response from Apache in the cache and serve from cache otherwise........in short, if Nginx does not serve a page, Apache was not able to pass responses to Nginx), but also proxy caching can easily be enabled via the Nginx Caching functionality that is present in Plesk version 17.8.11 and higher.

I hope that all of the above helps a bit........or points you in the right direction of the root cause of your problem.

Kind regards..........

PS It can be meaningful to run the procedure outlined in steps 1 to 3 twice, with ModSecurity disabled in the second run. After all, ModSecurity is on the Apache level and, as such, it can be the root cause of the problem.
 
Hi @trialotto canyou give some direction on how to "start with proxy caching"?

We were getting 503 errors with Ngnix turned on so disabled it. We turned on Apache PageSpeed and are getting watchdog seeing httpd down like every 30 minutes to every two hours. Can't seem to see in logs why.
 
Last edited:
@Jllynch

With respect to the

Hi @trialotto canyou give some direction on how to "start with proxy caching"?

statement, I must admit that there are some (private) conversations (between me and Plesk Staff) about the current state of the default Nginx caching configuration.

I also have to admit that I did offer (once, in a far past) to write some tutorial - now, I still have to find time to do so AND I am simply waiting for some decent improvements in the default Nginx caching configuration : at this moment, some customization of Nginx config templates are more or less required to get Nginx caching working properly.

Please remind me in the near future to keep my promise and to write a (simple) tutorial for Nginx based caching!

Regards........
 
Back
Top