Debug apache2 issues on Debian squeeze

  • Just a little heads-up for those of you running into trouble when wanting to debug issues in apache2 on Debian squeeze.
    Firstly apache2 on Debian squeeze is compiled with PIE support, which means the core-dumps can not be read by the ordinary gdb package on Debian since it's only version 7, and PIE first came after 7.1.
    A solution to this is to use the squeeze backport:…kports/amd64/gdb/download
    It will give you access to gdb 7.3 with PIE support.

    I needed this because my apache error log certainly started to get spammed with:
    [notice] child pid 19378 exit signal Segmentation fault (11)

    It spammed these messages every 5 minutes and nothing was logged in syslog/dmesg. I even checked for hardware faults but nothing found. This message led to apache2 stopped sending answers to users entering webpages our clients webpages, giving them a "503" error or "No data received".

    Install some missing packages:
    apt-get install apache2-dbg libapr1-dbg libaprutil1-dbg

    Enabled debug in apache2:
    nano /etc/apache2/apache2.conf
    Add: CoreDumpDirectory /tmp


    dpkg -i gdb_7.3-1~bpo60+1_amd64.deb

    /etc/init.d/apache2 restart

    Your dump file "core" should start to grow when the error in apache's error log arrives.

    Check the file: gdb apache2 /tmp/core

    In my case it was a module needed by mod_spdy that certainly started to act up, in this case:
    I changed nano /etc/apache2/mods-enabled/ssl.load to use instead of and it solved my seg faults.

    Hope this helps others in debugging issues with apache on squeeze.