hellau everyone,

i have a problem, that i cant resolve alone, so i need your help.

i have installed on a centos 7 apache when im asking for the status of the service (systemctl status httpd) so i got an error like this one:

  • Starting The Apache HTTP Server...
  • httpd.service operation timed out. Terminating httpd.service stopping timed out (2). Killing
  • Failed to start the Apache HTTP Server
  • Unit httpd.server entered failed state

i looked up in my error_log file (var/log/httpd/error_log/ and got this here

  • SELinux policy enabled: httpd running as context system_u:system_r:httpd_t:s0
  • suEXEC mechanism enabled (wrap per: /usr/sbin/suexec)
  • generation secret for digest authentification
  • no slotmen from mod_heartmonitor
  • pid file /run/httpd/httpd.pid overwritten -- Unclean shutdown previous Apache run?
  • Apache/2.4.6 (CentOS) PHP/5.4.16. configured -- resuming normal operations
  • Command line: '/usr/sbin/httpd - D FOREGROUND'

Yes, i have made this work and keyed this error statements, so i have no written the date and the information in []. i hope it is not so importent for resolve this problem.

i tried this already:

reboot systemctl --failed (it confirms the failure)

i havent got any idea. Can someone give my food for thought. Once it started, i tried to install icingaweb2 and now both is not working.

Thank you very much. mira

  • Are you trying to invoke the daemon as a service from systemd while running it as a foreground process? That's not going to work.
    – symcbean
    Jun 24, 2017 at 22:15
  • Have a look here apachelounge.com/viewtopic.php?p=28864
    – anand
    Jul 31, 2017 at 4:31

3 Answers 3


You don't need to modify systemd configurations. This is more likely an Apache config error.

You probably need to load the systemd module for apache. In CentOS 7's default httpd config there is a file 00-systemd.conf which is pulled into the apache config using the module include line that has this information. I bet if you load that, you'll find you problem resolved.

$ cat conf.modules.d/00-systemd.conf
# This file configures systemd module:
LoadModule systemd_module modules/mod_systemd.so

This usually occurs if you are copying over a config from another system that doesn't use systemd or perhaps upgrading from Apache 2.2 to Apache 2.4 where that module include directive isn't in the httpd.conf.

  • 1
    Thank you! This is on a test server so was playing with having that disabled, sure it started up last time without it!
    – user357577
    Aug 13, 2019 at 17:01
  • 1
    This just saved my day - thanks!
    – Marc
    Nov 24, 2020 at 15:05

I was facing the same error ([core:warn] [pid 10391] AH00098: pid file /var/run/httpd/httpd.pid overwritten -- Unclean shutdown of previous Apache run? ) and I've just solved it by replacing contents of file /usr/lib/systemd/system/httpd.service with:

Description=The Apache HTTP Server 
After=network.target remote-fs.target nss-lookup.target 

ExecStart=/usr/sbin/httpd $OPTIONS -k start 
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful 
ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop 


I don't know if it is related to this bug, but I took the answer from there.

  • 1
    This is a horrible idea. First, read the rest of that bug report to see that it was at best a temporary workaround while they searched for the real problem. Second, read the original httpd.service file to see why you shouldn't do it and what you should do instead. Jan 31, 2018 at 19:25

1) try starting apache like this:

/usr/sbin/httpd -DFOREGROUND -e debug

and look for a clue on what's stopping it.

2) try looking at Apache's stack backtrace. You can use pstack or gbd for this, or you might need to use mod_backtrace. See more info here under Determing why an apache process hung and Determing why an apache process crashed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.