Linux – Server freeze – how to debug

apache-2.2debianlinuxtroubleshooting

I am running a Debian virtual server with Apache, PHP, MySQL. There is just 1 website with very low traffic running but the server very often (almost everyday) freezes and does not respond.

When this happens the server is unreachable from web browser or by SSH and I have to go to administration of my provider and perform server hard reset after this the server seems to work fine.

How can I find out what is causing the freezes?

Linux vm2797 2.6.32-5-amd64 #1 SMP Tue Jun 14 09:42:28 UTC 2011 x86_64 GNU/Linux

Best Answer

Reconfigure your syslog to go to a different server -- this pushes events, any monitoring polls the server (probably miss the big segfault unless you poll at the exact instant it happens).

Grabbing logs to the machine that's crashing is a bad idea -- you will always lose the most import (read last) lines of the logs.

man rsyslog.conf gives info on redirecting to another machine, and how to configure to listen for logging messages.

The logs will show up in the syslog of the host prefaced with the name of the server they came from.

On the listening side 'man rsyslogd' will give you startup options which can then be set in /etc/default/rsyslog (you may need -4 or -6). You can verify it's listening with lsof -p pid_of_rsyslogd