Webhosting Blog

Configure Apache for core dump on segmentation faults


Sometimes  it is noticed that apache logs is generating segmentation faults and is crashing and all or some PHP pages are showing blank when you browse them. Check the apache error logs:

[Mon July 26 11:20:09 2010] [notice] child pid 9876 exit signal Segmentation fault (11)
[Mon July 26 11:20:09 2010]
[notice] child pid 9866 exit signal Segmentation fault (11)
[Mon July 26 11:20:09 2010]
[notice] child pid 9983 exit signal Segmentation fault (11)

Apache supports CoreDumpDirectory directive. This controls the directory to which Apache attempts to switch before dumping core.In order to solve this error you can follow following steps.

1) Login to the server as root.

2) We will need to edit the apache’s main configuration file for this.

[root@server~]# vi /etc/httpd/conf/httpd.conf

3) Add following line in the main config.

CoreDumpDirectory /tmp/apache2-gdb-dump

4) create the respective folder in /tmp.

root@server [~]#  mkdir -p /tmp/apache2-gdb-dump

5) Lets configure the permissions for the folder.

[root@server ~] # chmod 0777 /tmp/apache2-gdb-dump

[root@server~]# chown user.group /tmp/apache2-gdb-dump

Note: you Please can replace owner and group owner as per your requirement.

6) You can also  make changes to following file if required.

root@server [~] vi /usr/sbin/httpd

7) Locate the lines which say “ulimit” and add the “ulimit -c 0″ line below all these entries.

ulimit -n 1024
ulimit -n 4096
ulimit -n 8192
ulimit -n 16384
ulimit -c 0

8 ) Once done just restart the apache service.

root@server [~] /etc/init.d/httpd restart

This should help you to eliminate the error.

Advertisements

One response

  1. badtz maru

    You left out distilling httpd.conf so changes are not overwritten later.

    February 3, 2012 at 11:05 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s