Add this to httpd.conf:
CoreDumpDirectory /tmp/mycoredump
Create the directory, set permissions, and restart Apache:
mkdir /etc/httpd/mycoredump chown apache: /etc/httpd/mycoredump systemctl restart httpd
Read the core dump:
gdb /sbin/httpd /etc/httpd/mycoredump/coredumpfilename # (for backtrace) to get a stack trace from the time of the crash bt full
CoreDumpDirectory processing only occurs for a select set of fatal signals: SIGFPE, SIGILL, SIGABORT, SIGSEGV, and SIGBUS.
To test and generate a core dump for Apache do the following:
# send SIGILL, Illegal instruction (ANSI) to Apache: kill -s 4 pidofapache