4

I've installed http24u onto a CentOS 7 VM and the httpd service won't startup properly, it'll start for about 30 seconds or so and then crash out with the below message which doesn't mean anything to me, can anyone shed any light on it please or any suggestions?

journalctl

-- Unit httpd.service has begun starting up.
Jun 29 11:02:38 api01 systemd[1]: httpd.service start operation timed out. Terminating.
Jun 29 11:02:39 api01 systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Jun 29 11:02:39 api01 systemd[1]: Unit httpd.service entered failed state.
Jun 29 11:02:39 api01 systemd[1]: httpd.service failed.
Jun 29 11:02:39 api01 polkitd[811]: Unregistered Authentication Agent for unix-process:31718:120305844 (system bus name :1.1444, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_IE.UT
lines 3675-3731/3731 (END)

Apache Logs

[Wed Jun 29 11:36:18.095653 2016] [:notice] [pid 31869:tid 139893291845824] ModSecurity for Apache/2.7.3 (http://www.modsecurity.org/) configured.
[Wed Jun 29 11:36:18.095789 2016] [:notice] [pid 31869:tid 139893291845824] ModSecurity: APR compiled version="1.4.8"; loaded version="1.5.2"
[Wed Jun 29 11:36:18.095797 2016] [:warn] [pid 31869:tid 139893291845824] ModSecurity: Loaded APR do not match with compiled!
[Wed Jun 29 11:36:18.095803 2016] [:notice] [pid 31869:tid 139893291845824] ModSecurity: PCRE compiled version="8.32 "; loaded version="8.32 2012-11-30"
[Wed Jun 29 11:36:18.095807 2016] [:notice] [pid 31869:tid 139893291845824] ModSecurity: LUA compiled version="Lua 5.1"
[Wed Jun 29 11:36:18.095816 2016] [:notice] [pid 31869:tid 139893291845824] ModSecurity: LIBXML compiled version="2.9.1"
[Wed Jun 29 11:36:18.095820 2016] [:notice] [pid 31869:tid 139893291845824] Original server signature: Apache
[Wed Jun 29 11:36:18.181331 2016] [mpm_event:notice] [pid 31869:tid 139893291845824] AH00489: Apache/2.4.20 (CentOS) OpenSSL/1.0.1e-fips Skynet configured -- resuming normal operations
[Wed Jun 29 11:36:18.181422 2016] [core:notice] [pid 31869:tid 139893291845824] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Jun 29 11:37:48.132327 2016] [mpm_event:notice] [pid 31869:tid 139893291845824] AH00492: caught SIGWINCH, shutting down gracefully

systemctl start httpd

This is what I see on a systemctl status httpd just before it crashes.

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: activating (start) since Wed 2016-06-29 14:42:03 IST; 25s ago
 Main PID: 32435 (httpd)
   CGroup: /system.slice/httpd.service
           ├─32435 /usr/sbin/httpd -DFOREGROUND
           ├─32439 /usr/sbin/rotatelogs /var/log/httpd/error_log.%Y-%m-%d 86400
           ├─32440 /usr/sbin/rotatelogs /var/log/httpd/access_log.%Y-%m-%d 86400
           ├─32441 /usr/sbin/rotatelogs /var/log/httpd/access_log.%Y-%m-%d 86400
           ├─32442 /usr/sbin/httpd -DFOREGROUND
           ├─32443 /usr/sbin/httpd -DFOREGROUND
           └─32444 /usr/sbin/httpd -DFOREGROUND

Jun 29 14:42:03 api01 systemd[1]: Starting The Apache HTTP Server...

And after it crashes:

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Wed 2016-06-29 14:43:34 IST; 38s ago
  Process: 32435 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)
 Main PID: 32435 (code=exited, status=0/SUCCESS)

Jun 29 14:42:03 api01 systemd[1]: Starting The Apache HTTP Server...
Jun 29 14:43:33 api01 systemd[1]: httpd.service start operation timed out. Terminating.
Jun 29 14:43:34 api01 systemd[1]: Failed to start The Apache HTTP Server.
Jun 29 14:43:34 api01 systemd[1]: Unit httpd.service entered failed state.
Jun 29 14:43:34 api01 systemd[1]: httpd.service failed.
4
  • Try to run journalctl to find out more information about why does it fail to start or you can manually run httpd in foreground with debug logging to see what is wrong with it. Jun 29, 2016 at 10:47
  • journalctl gives the output in the question above.
    – llanato
    Jun 29, 2016 at 11:15
  • What do your apache logs say. ?
    – user9517
    Jun 29, 2016 at 11:18
  • @Iain, I've updated the question with the apache logs, its just that snippet over and over, nothing else in the logs.
    – llanato
    Jun 29, 2016 at 11:21

5 Answers 5

4

I had this issue yesterday on Centos7, nothing in the logs to suggest what the issue was.

I could run apache, but not from systemctl - it would be available for about 90 seconds before deciding it had failed to start and then killing the service.

My situation turned out to be DNS being blocked on a new firewall I was not aware of; unblocking the DNS resolved my issue.

0
4

I struggled with this same issue for a few days. My issue was I was missing the following module:

LoadModule systemd_module modules/mod_systemd.so

Adding that module to my httpd.conf resolved the issue for me. I was also using prefork, but don't know if using worker or event would have changed this or not.

1

It's due to the httpd pid file still present after a system crash. Systemd still see the service has started...

On my side I had a ExecPreStart option like this :

ExecPreStart=[[ -f /var/run/httpd/httpd.pid ]] && /bin/rm -f /var/run/httpd/httpd.pid

Maybe there is a more elegant solution...

1

None of the other solutions here were appropriate for us. I finally found a solution that worked. The solution comes from The Geek Diary. After running their prescribed solution, restarts of polkitd followed by apache no longer resulted in the mysterious and frustrating "Unregistered Authentication Agent" message.

Summarizing the solution:

rpm -Va polkit 
rpm --setugids polkit polkit-pkla-compat
rpm --setperms polkit polkit-pkla-compat

systemctl restart polkit
sleep 5
systemctl status polkit

If you don't see the "Unregistered Authentication Agent" by now, you should be able to reload httpd without problems. Strangely, I could not find any problems that these commands actually fixed. But it was the only solution that worked.

Note (and maybe someone else can explain this to me): once you restart/reload httpd, the polkit status shows the same messages:

polkitd[29321]: Registered Authentication Agent for unix-process:29677:196512865 (system bus name :1.31 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
polkitd[29321]: Unregistered Authentication Agent for unix-process: 29677:196512865 (system bus name :1.31, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
0

I fixed this by rebooting the server and found port 80 to be closed again!

$ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
$ sudo firewall-cmd --reload

After this, all was working once again. Still not sure how it happened to begin with though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .