简体   繁体   English

Apache 服务器将无法启动,但在“激活”时工作并且没有给出任何有意义的错误

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

  • Apache 2.4.6 Apache 2.4.6
  • RHEL 7.9 RHEL 7.9
  • PHP 7.4.30 PHP 7.4.30

Running this in a Google VM!在 Google VM 中运行它!

Ran "apachectl configtest" and got a "Syntax OK" message.运行“apachectl configtest”并收到“语法正常”消息。 Turned debug logging on in httpd.conf and started the process.在 httpd.conf 中打开调试日志并启动该过程。

This is the output of systemctl status httpd这是systemctl status httpd的output

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:这是error_log中的output:

[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.在 web 浏览器中插入服务器 IP 可以毫无问题地加载页面。 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.需要加载 systemd_module。 I added this line in httpd.conf...我在 httpd.conf 中添加了这一行...

LoadModule systemd_module modules/mod_systemd.so

... and viola - it works. ...和中提琴 - 它有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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