Centos – Apache Server shutting down, whats the reason

apache-2.2centosPHP

I'm quite new to Linux so I don't really know how to fix this problem.

I have a vServer running on CentOS, managed by Plesk 10. My website shuts down randomly for a few hours now.

The error in the apache log says the following:

[Sun Aug 19 21:31:00 2012] [notice] caught SIGTERM, shutting down
[Sun Aug 19 21:32:21 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Aug 19 21:32:22 2012] [warn] RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
[Sun Aug 19 21:32:22 2012] [warn] RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
[Sun Aug 19 21:32:22 2012] [warn] RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
[Sun Aug 19 21:32:22 2012] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 19 21:32:22 2012] [notice] Digest: generating secret for digest authentication ...
[Sun Aug 19 21:32:22 2012] [notice] Digest: done
PHP Warning:  Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
[Sun Aug 19 21:32:22 2012] [warn] RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
[Sun Aug 19 21:32:22 2012] [warn] RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
[Sun Aug 19 21:32:22 2012] [warn] RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
[Sun Aug 19 21:32:22 2012] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 19 21:32:22 2012] [notice] Apache/2.2.15 (Unix) DAV/2 mod_fcgid/2.3.6 mod_ssl/2.2.15 OpenSSL/1.0.0-fips configured -- resuming normal operations

Best Answer

Something is sending it sigterm, says the first line. That will always originate externally. Perhaps there is a cronjob set to restart it periodically? Perhaps there is a problem with plesk? It is impossible to say from that log what has happened, except that something issued a command to shut it down.

It's possible, given that it is doing init stuff after it's stopped, that a watchdog is assuming it is hung and restarting it. If that's the case, and you notice it's down for a while, check that you have enough entropy in your entropy pool or change the random device to /dev/urandom (possible security weakness if you do that). After it is started, apache will often block and wait for random data (for SSL) before servicing any requests, SSL or not.