• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Nginx crashes at the same time every day (after I receive an email about application updates

fuf

New Pleskian
I'm new to Plesk (and server admin in general) so please excuse what may be a simple issue.

This has happened the last four days in a row:
* At 06:29 I get an email from my Plesk server with the subject "Application Updates." It only lists one plugin update for a WordPress site, even though when I check the WP toolkit there are other plugin updates on other WP sites
* Immediately after (also at 06:29) I get a string of emails from uptimerobot.com saying that the sites hosted on the Plesk server are no longer accessible.
* All sites return a 502 error
* The Plesk admin still works
* I can fix the sites by running:
# /usr/local/psa/admin/bin/nginxmng --disable
# /usr/local/psa/admin/bin/nginxmng --enable

It seems as though the Plesk scheduled task that checks for application updates (and does other stuff?) is causing nginx to stop working.

Any ideas on how to start fixing?

Bonus question: can I change the time that this scheduled task takes place so that I'm more likely to be awake and at my desk if something goes wrong?

Many thanks.
 
Thanks Julian.

I ran those two commands.

I guess we'll see tomorrow morning if that made any difference. :)
 
Hi fuf,

i doubt that the suggestions from @Julian Johannsen may solve your issue(s), because all point to a well known "logrotate" - issue, where your apache webserver crashes, due to several ( instant processing ) "reloads", which can result in left-over pid-files, when watchdog for example noticed a non-working apache - webserver and tries to restart the service, which makes it impossible to automatically restart your apache - webserver.

Pls. consider to change => "/etc/logrotate.d/apache2" ( for Debian/Ubuntu - based systems ) from:

Code:
...
    postrotate
                if /etc/init.d/apache2 status > /dev/null ; then \
                    /etc/init.d/apache2 reload > /dev/null; \
                fi;
...

to:
Code:
...
    postrotate
                if /etc/init.d/apache2 status > /dev/null ; then \
                    /etc/init.d/apache2 restart > /dev/null; \
                fi;
...


In addition, consider as well to change at "/etc/logrotate.d/mod_security" ( for Debian/Ubuntu - based systems ) from:

Code:
...
    postrotate
        /etc/init.d/apache2 reload > /dev/null 2>/dev/null || true
...

to:
Code:
...
    postrotate
        /etc/init.d/apache2 restart > /dev/null 2>/dev/null || true
...


It could be as well a good idea to increase the log - level for apache and nginx ( to "debug" - log - level ), to be able to investigate the issue far better.
Pls. don't try to compair a "working" Plesk Control Panel with this issue, because Plesk uses it's very own webserver ( => sw-cp-server )
 
Last edited by a moderator:
Thanks UFHH01 :)

I've made your suggested changes to /etc/logrotate.d/apache2 and /etc/logrotate.d/mod_security

We'll see what happens tomorrow.
 
Back
Top