Apache core dumps on Ubuntu

August 03, 2011 – tagged Apache, Ubuntu, Howto, Debugging

...need apport installed and running, otherwise the core won't be dumped.

To make the description complete:

  1. Add CoreDumpDirectory /tmp/apachedumps/ to apache2.conf.
  2. Create the directory and sudo chown www-data /tmp/apachedumps it.
  3. sudo apt-get install apport and edit /etc/default/apport to start apport automatically.
  4. Add the line www-data - core unlimited to /etc/security/limits.conf in order to allow core dumps of unlimited size to apache.

That's basically it. Now, when you kill -11 an apache process, you will not get a core dump in /tmp/apachedumps (even though the error.log says so), but you will have a complete description of the crash (including the base64-encoded dump) written by apport to /var/crash. The core dump can then be extracted from there using apport-unpack.