Got an intermittent crash with Apache? If the server is Seg Faulting, you can try the following :-
Note – this worked for us using a Centos 5 Server with Apache 2.
Read Apache's advice on crashing here: http://httpd.apache.org/dev/debugging.html#crashes
Edit the hosts.conf file to enable core dumping
This could be the file /etc/httpd/zzzz_YOUR_CUSTOM_CONFIG.conf (our Apache appended custom config)
1. Add the following lines (ours are in permanently commented)
# enable core dumps
CoreDumpDirectory /var/tmp
# enable rewrite logging
RewriteLog "/var/log/httpd/rewrite_log"
# set rewrite log level
RewriteLogLevel 3
This also enables Rewrite logging so if your problem is related to modrewrite, you've got a chance to pinpoint it.
2. Next, enable core dumps by removing any restrictions placed on them by the kernel like so in your server console:
ulimit -c unlimited
3. Restart Apache
service httpd restart
That's it! Remember not to leave it on for too long as Core dumps can be very big! Also, mod rewrite logging is a resource hog.
—
To undo –
1. reset the resource restrictions on your server console:
ulimit -c 0
2. Comment the same three lines in the Apache conf file.
3. Restart Apache
service httpd restart
Happy debugging!