Even after setting
ulimit -c unlimited in the shell I could not find a core dump file when my apache2 server crashed. In my Ubuntu system I enabled core dump in /etc/default/apport. Still I could not see core dumps. But I could produce a core dump for a simple C program. But still not for Apache2. Finally I found that I need to configure Apache2 for core dumps from here
http://www.cyberciti.biz/tips/configure-apache-web-server-for-core-dump.html
Also following link could be useful for Ubuntu users
https://wiki.kubuntu.org/Apport