Red Hat Enterprise Linux > AS/ES/WS Basics > Issue
<<
15 of 908
>>
Issue:
How do I configure a Red Hat Enterprise Linux system so that Apache can dump core files on segmentation faults?
Resolution:
- Within the main Apache configuration file /etc/httpd/conf/httpd.conf add line at bottom of file:
CoreDumpDirectory /var/apache-dump
|
- 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
|
- Edit the file /etc/security/limits.conf and add line:
- 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
|
- 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
|
- 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: "
|
- 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
|
- Reboot or restart apache
service httpd restart
- 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.
Red Hat Enterprise Linux
>
AS/ES/WS Basics
> Issue
<<
15
of
908
>>