Skip to content
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Solutions
    By Role
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    By Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    By Cloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    Partner Program
    Exclusive discounts, benefits and exposure to take your business to the next level
    Become a partner
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    Explore Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    Key Topics
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    Feature Packs
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    Featured Extension
    SocialBee
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • Extension
  • Pricing
  • Extensions
  • Help Center
  • More
    • Careers
    • Events
    • Plesk University
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL

Knowledge Base

How to enable core dumps for Apache and trace Apache segmentation fault on a Linux server

 
apachecentoscentos 7debiandebug

Question

How to enable core dumps for Apache and trace Apache segmentation fault on a Linux server?

Answer

 

Enabling core dumps for Apache

  1. Connect to a Linux server via SSH.

  2. Find a partition that is having a free space (use 'df -h') enough to store memory dumps. In this example, we use /var directory on the root '/' partition.

    Note: On CentOS 7, due to the PrivateTmp=true parameter in a systemd unit, it is not possible to use some directories inside /tmp/ as a directory for core dumps.

  3. Modify Apache startup script:

    • For systemd systems, create a new unit file using the command:

      • on CentOS/RHEL-based distributions

        # systemctl edit httpd

      • on Debian/Ubuntu-based distributions

        # systemctl edit apache2

      and add the following lines:

      [Service]
      LimitCORE=infinity

    • For non-systemd CentOS/RHEL-based systems, add the DAEMON_COREFILE_LIMIT=unlimited line to the /etc/sysconfig/httpd file.

    • For non-systemd Debian/Ubuntu-based systems, open the /etc/init.d/apache2 file and locate the do_start() section. Add the following line in this section:

      ulimit -c unlimited

  4. Create a folder where core dumps will be stored:

    # mkdir -p /var/coredumps
    # chmod a+w /var/coredumps

  5. Specify the path and pattern for core dump files in the /proc/sys/kernel/core_pattern file:

    # echo /var/coredumps/core-%e-%s-%u-%g-%p-%t > /proc/sys/kernel/core_pattern

    If for some reason the core_pattern file cannot be modified, specify a CoreDumpDirectory location in /etc/httpd/conf/httpd.conf (CentOS/RHEL) or /etc/apache2/apache2.conf (Debian/Ubuntu):

    # grep "CoreDumpDirectory" /etc/httpd/conf/httpd.conf
    CoreDumpDirectory /var/coredumps

  6. Restart Apache service:

    • on CentOS/RHEL-based distributions

      # service httpd restart

    • on Debian/Ubuntu-based distributions

      # service apache2 restart

  7. To be sure core dumps have been set up, perform the following test:

    7.1. List Apache processes and their PIDs:

    • on CentOS/RHEL-based distributions

      # ps auxf | grep httpd | grep -v grep
      root 15654 1.4 0.7 372448 13840 ? Ssl 13:25 0:00 /usr/sbin/httpd -DFOREGROUND
      apache 15680 0.0 0.3 370944 6164 ? S 13:25 0:00 _ /usr/sbin/httpd -DFOREGROUND

    • on Debian/Ubuntu-based distributions

      # ps auxf | grep apache2 | grep -v grep
      root 2410 0.2 1.5 292588 33036 ? Ssl 13:32 0:00 /usr/sbin/apache2 -k start
      www-data 2413 0.0 0.3 237808 6504 ? S 13:32 0:00 _ /usr/sbin/apache2 -k start

    7.2. Kill a main Apache process with SIGSEGV signal:

    # kill -SIGSEGV <PID>

    7.3. Check the folder with core dumps. The files will be named like:

    • on CentOS/RHEL-based distributions

      # ls /var/coredumps
      core-httpd-11-0-0-14750-1556864320

    • on Debian/Ubuntu-based distributions

      # ls /var/coredumps
      core-!usr!sbin!apach-11-0-0-2410-1556865180

    Note: If the abrtd daemon is running, it will prevent creation of core dump files.

  8. Reproduce the issue.

    Once you finish with tracing, remove the changes in Apache startup script made on step 3 and restart Apache.

 

Analyzing Apache core dumps

 

Note: On ubuntu 22, apache2-dbg package has been dropped. For other debug packages, check this Ubuntu documentation page.

  1. Install the gdb utility:

    • on CentOS/RHEL-based distributions

      # yum install gdb
      # debuginfo-install httpd

    • on Debian/Ubuntu-based distributions

      # apt-get install gdb
      # apt-get install apache2-dbg

  2. Replace the path to a core dump file in the command below and run it:

    • on CentOS/RHEL-based distributions

      # gdb /usr/sbin/httpd /var…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Your Complete .htaccess Guide: Including .htaccess Basics and More

Read More »

NGINX vs Apache – Which Is the Best Web Server in 2024?

Read More »

Top Web Servers For Linux And Windows

Read More »
Knowledge Base

Website on Plesk for Linux server with Apache 2.4 does not work with Apache 2.2 syntax in file .htaccess: client denied by server configuration

Read More »

Unable to upload large files to website hosted on Plesk for Linux server: End of script output before headers

Read More »

Error in Plesk inteface: New configuration files were not created: Could not open configuration file: No such file or directory

Read More »

How to enable/disable Apache modules shipped with Plesk

Read More »

Hosting Wiki

  • Server Redundancy
  • Linux Containers
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • Plesk
  • Apache Tomcat
  • Apache
  • Web Server
  • DNS Server
  • SSH

Industry
Partners

industry-partner_ALIBABA
industry-partner_GOOGLEPARTNER
industry-partner_MICROSOFT
industry-partner_REDHAT-r2
industry-partner_ALIBABA
industry-partner_AUTOMATTIC
industry-partner_AWS
industry-partner_DIGITALOCEAN
industry-partner_SCALEWAY
Follow us:
Facebook Twitter Linkedin Youtube Github

COMPANY

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY

Blog
Forums 
Plesk University

First defaul

Company

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE​

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS​

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY​

Blog
Forums
Plesk University

Follow us:
Facebook Twitter Linkedin Youtube Github

© 2025 WebPros International GmbH. All rights reserved. Plesk and the Plesk logo are trademarks of WebPros International GmbH.

Managed with love with Plesk WP Toolkit