Watchdog reports that webserver is restarted

Created:

2016-11-16 13:22:37 UTC

Modified:

2017-08-16 17:27:51 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Watchdog reports that webserver is restarted

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

Watchdog reports that the webserver has been restarted:

The Web Server (Apache) service on host example.com is down.
The problem was discovered on Oct 29, 2013 03:00.

There are the following errors in Apache logs - /var/log/apache2/error.log on Debian/Ubuntu, /var/log/httpd/error_log` on CentOS:

    [Sat Jan 21 11:05:12 2017] [notice] caught SIGTERM, shutting down
...
[Sat Jan 21 11:05:19 2017] [notice] Apache/2.2.15 (Unix) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips Apache mod_fcgid/2.3.9 mod_jk/1.2.40 mod_python/3.3.1 Python/2.6.6 mod_wsgi/3.2 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations

OR

[Wed Oct 30 14:51:53 2013] [error] [client X.X.X.X] script '/var/www/vhosts/default/htdocs/wp-login.php' not found or unable to stat
[Wed Oct 30 15:04:37 2013] [error] [client X.X.X.X] File does not exist: /var/www/vhosts/default/htdocs/sitemap.xml

Watchdog /var/log/plesk/modules/monit.log contains the error:

    [CET Oct 29 15:00:08] 'apache' failed protocol test [generic] at INET[203.0.113.2:80]
[EST Jan 29 05:58:05] 'apache' trying to restart
[EST Jan 29 05:58:05] 'apache' stop: /usr/local/psa/admin/bin/websrvmng
[EST Jan 29 05:58:29] 'apache' start: /usr/local/psa/admin/bin/websrvmng
[EST Jan 29 06:03:32] 'apache' connection passed

Cause

Timeout limit is exceeded.The error from watchdog log means that the service did not respond to watchdog control message during the timeout configured in watchdog settings.

Resolution

This issue is fixed in Plesk 12.5: Plesk tunes limits automatically for Apache and Nginx depending on domains count.

For Plesk 12.0, the following workaround can be applied.

Note : this workaround works only with Nginx version 1.9.2 or later.

  1. Increase the timeout for Apache service to 20 seconds in watchdog settings - /opt/psa/etc/modules/watchdog/monitrc on Debian/Ubuntu, /usr/local/psa/etc/modules/watchdog/monitrc on CentOS:

    # Apache
    check process apache
    with pidfile "/var/run/apache2.pid"
    start = "/opt/psa/admin/bin/websrvmng --start"
    stop = "/opt/psa/admin/bin/websrvmng --stop"
    if failed host X.X.X.Xport 80 send "GET / HTTP/1.1\\r\
    Host: X.X.X.X\r\\r\" expect "HTTP/1\.[01x] [1-4][0-9]{2} .*\r\" with timeout 20 seconds then restart if 5 restarts within 5 cycles then timeout every 1 cycles mode active
  2. Add the following into - /etc/nginx/ulimit.global_params - Debian/Ubuntu, etc/sysconfig/nginx - CentOS:

    NGINX_ULIMIT=“-n 4096”
  3. Add the below string into /etc/nginx/ulimit.global_params :

    worker_rlimit_nofile 4096;
Have more questions? Submit a request
Please sign in to leave a comment.