Sean’s Obsessions

  • Archives

27 Jul

Finally, getting Apache to core

I’ve had some problems with Apache and I’d like a core dump when it happens so I can get a backtrace.

It’s harder than you think. Red Hat has 2 documents on it: this and that.

The summary of those is to add

CoreDumpDirectory /var/apache-dump

to httpd.conf, and make that directory 777. Then, edit some startup scripts to run ulimit -n unlimited.

What I had to do to get it working was:

/etc/sysctl.conf:
kernel.suid_dumpable = 1
kernel.core_pattern = /var/apache-dump/%e-%t-%p

to get it to work.

As an aside, the ulimit -c unlimited hacks seems unnecessary, you can add

DAEMON_COREFILE_LIMIT=999999999

(or possibly even “unlimited” ) to /etc/sysconfig/httpd, as part of /etc/init.d/functions checks that (that goes for any service, too)

One Response to “Finally, getting Apache to core”

  1. 1
    Lucas Ryan Says:

    I tried this and it didn’t work but eventually realized that I also needed to configure SELinux so that /var/apache-dump was writable by apache … just throwing that out that to save someone else time to runs into this post.

Leave a Reply

Stop blog spam today with the Herculean, strong, profound, and ample Wordpress Hash-cash.

© 2008 Sean’s Obsessions | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4Sudoku, based on Pinkline byGPS Gazette