简体   繁体   中英

Apache server will not start, but works while it's "Activating" and does not give any meaningful errors

  • Apache 2.4.6
  • RHEL 7.9
  • PHP 7.4.30

Running this in a Google VM!

Ran "apachectl configtest" and got a "Syntax OK" message. Turned debug logging on in httpd.conf and started the process.

This is the output of systemctl status httpd

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: activating (start) since Tue 2022-08-23 22:59:59 UTC; 7s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 1866 (httpd)
   CGroup: /system.slice/httpd.service
           ├─1866 /usr/sbin/httpd -DFOREGROUND
           ├─1867 /usr/sbin/httpd -DFOREGROUND
           ├─1868 /usr/sbin/httpd -DFOREGROUND
           ├─1869 /usr/sbin/httpd -DFOREGROUND
           ├─1870 /usr/sbin/httpd -DFOREGROUND
           └─1871 /usr/sbin/httpd -DFOREGROUND

Here is the output in error_log:

[Tue Aug 23 22:59:59.144963 2022] [core:notice] [pid 1866] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Aug 23 22:59:59.146252 2022] [suexec:notice] [pid 1866] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Aug 23 22:59:59.183943 2022] [core:warn] [pid 1866] AH00098: pid file /etc/httpd/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Tue Aug 23 22:59:59.187253 2022] [proxy:debug] [pid 1867] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Tue Aug 23 22:59:59.187346 2022] [proxy:debug] [pid 1867] proxy_util.c(1888): AH00927: initializing worker proxy:reverse local
[Tue Aug 23 22:59:59.187378 2022] [proxy:debug] [pid 1867] proxy_util.c(1939): AH00931: initialized single connection worker in child 1867 for (*)
[Tue Aug 23 22:59:59.188948 2022] [proxy:debug] [pid 1868] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Tue Aug 23 22:59:59.189021 2022] [proxy:debug] [pid 1868] proxy_util.c(1888): AH00927: initializing worker proxy:reverse local
[Tue Aug 23 22:59:59.189047 2022] [proxy:debug] [pid 1868] proxy_util.c(1939): AH00931: initialized single connection worker in child 1868 for (*)
[Tue Aug 23 22:59:59.190495 2022] [proxy:debug] [pid 1869] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Tue Aug 23 22:59:59.190562 2022] [proxy:debug] [pid 1869] proxy_util.c(1888): AH00927: initializing worker proxy:reverse local
[Tue Aug 23 22:59:59.190596 2022] [proxy:debug] [pid 1869] proxy_util.c(1939): AH00931: initialized single connection worker in child 1869 for (*)
[Tue Aug 23 22:59:59.190866 2022] [mpm_prefork:notice] [pid 1866] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/7.4.30 configured -- resuming normal operations
[Tue Aug 23 22:59:59.190886 2022] [mpm_prefork:info] [pid 1866] AH00164: Server built: Mar 22 2022 15:35:18
[Tue Aug 23 22:59:59.190901 2022] [core:notice] [pid 1866] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Aug 23 22:59:59.190921 2022] [mpm_prefork:debug] [pid 1866] prefork.c(1005): AH00165: Accept mutex: sysvsem (default: sysvsem)
[Tue Aug 23 22:59:59.192147 2022] [proxy:debug] [pid 1870] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Tue Aug 23 22:59:59.192152 2022] [proxy:debug] [pid 1871] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Tue Aug 23 22:59:59.192217 2022] [proxy:debug] [pid 1871] proxy_util.c(1888): AH00927: initializing worker proxy:reverse local
[Tue Aug 23 22:59:59.192253 2022] [proxy:debug] [pid 1871] proxy_util.c(1939): AH00931: initialized single connection worker in child 1871 for (*)
[Tue Aug 23 22:59:59.192298 2022] [proxy:debug] [pid 1870] proxy_util.c(1888): AH00927: initializing worker proxy:reverse local
[Tue Aug 23 22:59:59.192332 2022] [proxy:debug] [pid 1870] proxy_util.c(1939): AH00931: initialized single connection worker in child 1870 for (*)

Plugging the server IP in a web browser loads the page with no issues. However, after a little while, the start process will timeout and the app will exit.

What am I missing?

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: signal) since Tue 2022-08-23 23:02:59 UTC; 15s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 1866 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=killed, signal=KILL)
 Main PID: 1866 (code=killed, signal=KILL)

Aug 23 22:59:59 instance-1 systemd[1]: Starting The Apache HTTP Server...
Aug 23 23:01:29 instance-1 systemd[1]: httpd.service start operation timed out. Terminating.
Aug 23 23:02:59 instance-1 systemd[1]: httpd.service stop-sigterm timed out. Killing.
Aug 23 23:02:59 instance-1 systemd[1]: httpd.service: main process exited, code=killed, status=9/KILL
Aug 23 23:02:59 instance-1 systemd[1]: Failed to start The Apache HTTP Server.
Aug 23 23:02:59 instance-1 systemd[1]: Unit httpd.service entered failed state.
Aug 23 23:02:59 instance-1 systemd[1]: httpd.service failed.

Hah... I found the solution. Needed to load the systemd_module. I added this line in httpd.conf...

LoadModule systemd_module modules/mod_systemd.so

... and viola - it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM