Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > AS/ES/WS Basics > Issue <<  15 of 908 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 3652
Last update: 06-17-08
Issue:
How do I configure a Red Hat Enterprise Linux system so that Apache can dump core files on segmentation faults?
Resolution:
  1. Within the main Apache configuration file /etc/httpd/conf/httpd.conf add line at bottom of file:

     
    CoreDumpDirectory /var/apache-dump
       


  2. Create a new /var/apache-dump directory and correctly set ownership and permissions on directory:

      
    # ps aux | grep http | tail -n 2
    # mkdir /var/apache-dump
    # chown apache.apache /var/apache-dump     
    
       NOTE: Change apache.apache to the username shown on 
             the ps output for your system.
    
    # chmod 0770 /var/apache-dump
    # ls -ld /var/apache-dump
    drwxrwx---    2 apache   apache   4096 Aug 16 10:59 /var/apache-dump
       


  3. Edit the file /etc/security/limits.conf and add line:

      
    *               -       core    unlimited
       


  4. Edit the file /etc/profile and change line :

      
    ulimit -S -c 0 > /dev/null 2>1
       

    to:

     
    ulimit -S -c unlimited > /dev/null 2>1
       


  5. Edit the file /etc/init.d/functions and place a "#" in front of line:

     
            ulimit -S -c 0 >/dev/null 2>1
       

    to:

     
            #ulimit -S -c 0 >/dev/null 2>1
       


  6. Edit the file /etc/init.d/httpd and add a ulimit -c unlimited statement at the top of the start() section:

     
    start() {
            ulimit -c unlimited
            echo -n $"Starting $prog: "
       


  7. Enable writing the PID to the core file after reboots (if this is an Enterprise Linux 3 server, enable setuid_ok as well), edit the /etc/sysctl.conf file and add :

      
    kernel.core_uses_pid = 1
    # Following needed for Enterprise Linux 3 servers
    kernel.core_setuid_ok = 1    
       


    Also, echo this value into proc with the following command in order for this configuration change to take effect immediately:

     
    # echo 1 > /proc/sys/kernel/core_uses_pid
    # echo 1 > /proc/sys/kernel/core_setuid_ok
       


  8. Reboot or restart apache
    service httpd restart
    
  9. To test, use ps aux to list any Apache process and then kill -11 <PID> - then check the /var/apache-dump/ directory for new core file.

     
    # ps aux | grep htt | tail -n 2
    apache    1331  0.0  2.6 80152 6776 ?        S    13:59   0:00 /usr/sbin/httpd -
    apache    1333  0.0  2.6 80152 6776 ?        S    13:59   0:00 /usr/sbin/httpd -
    # kill -11 1333
    # ls -ld /var/apache-dump/core.1333
    -rw-------    1 apache   apache   71188480 Aug 16 13:48 /var/apache-dump/core.1333
       


Once you have a core file from Apache, you can use the information from other knowledgebase articles to read the core files created by Apache on Red Hat Enterprise Linux systems.


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > AS/ES/WS Basics > Issue <<   15  of  908  >>