Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've followed instructions from many locations online on how to get a core dump from apache when it is producing a segfault, but it still refuses to generate the dump.

I have:

  1. Added the CoreDumpDirectory directive into the httpd.conf file and set it to /tmp
  2. Executed ulimit -c unlimited
  3. Provided the pattern for dumps using echo '/tmp/core-%e.%p' > /proc/sys/kernel/core_pattern
  4. Also ran echo 0 > /proc/sys/kernel/core_uses_pid

Httpd has been restarted, but still no dumps created.

I'm running CentOS 5.8 x64 with httpd-2.2.3-65.el5.centos.3 and php-5.3.20-13.el5.art

Any help would be much appreciated!

share|improve this question
    
Does apache have any permission to write to the file you specified in CoreDumpDirectory directive? It should be owned by apache. –  val0x00ff Jan 18 '13 at 15:43
    
I've set it to /tmp which is publicly writable, but I'll try somewhere else and give it ownership to apache –  chrismcb Jan 18 '13 at 15:48
    
Thanks - that did produce a dump, however not in the place I set it! I set the CoreDumpDirectory to /tmp/dumps and it dumped to /tmp... now on with debugging –  chrismcb Jan 18 '13 at 15:53
    
Glad you figured it out! –  val0x00ff Jan 18 '13 at 15:54

1 Answer 1

up vote 1 down vote accepted

My answer is this:

  1. Set up the directive as follow

    CoreDumpDirectory /tmp/mycoredump

  2. Create the directory:

    mkdir -p /tmp/mycoredump

  3. Assign ownership to the directory www-data or httpd

    chown -R www-data:www-data /tmp/mycoredump

  4. Set permissions to:

    chmod 777 /tmp/mycoredump

  5. Restart Apache:

    service apache2 restart

share|improve this answer
    
Yes, I did just about that, but it ended up dumping into /tmp anyway! –  chrismcb Jan 18 '13 at 15:54
    
It's never a good idea to chmod 777 anything –  sendmoreinfo Jan 19 '13 at 19:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.