Apache 无法启动(centos)

Apache 无法启动(centos)

我在使用 apache 时遇到了问题:centos 7 + directamin + custombuild 版本 nginx_apache 我今天早上重启了我的服务,但 apache 却没有启动。我测试了 ./build all 或仅 apache....

systemctl start httpd.service
     Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.    



systemctl status httpd.service
     httpd.service - The Apache HTTP Server
   Loaded: loaded (/etc/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Wed 2014-11-12 08:26:54 CET; 3s ago
  Process: 8394 ExecStart=/usr/sbin/httpd $OPTIONS -k start (code=exited, status=1/FAILURE)
 Main PID: 18796 (code=killed, signal=KILL)

Nov 12 08:26:54 s024.dedibox.fr systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 12 08:26:54 s024.dedibox.fr systemd[1]: Failed to start The Apache HTTP Server.
Nov 12 08:26:54 s024.dedibox.fr systemd[1]: Unit httpd.service entered failed state.


journalctl -xn
     -- Logs begin at Sun 2014-11-02 20:23:36 CET, end at Wed 2014-11-12 08:27:08 CET. --
Nov 12 08:27:06 s024.dedibox.fr systemd-logind[1100]: Removed session 15720.
-- Subject: A session 15720 has been terminated
-- Defined-By: systemd
-- Support: http:// lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http:// www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A session with the ID 15720 has been terminated.
Nov 12 08:27:07 s024.dedibox.fr systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http:// lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
Nov 12 08:27:08 sd024.dedibox.fr systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 12 08:27:08 sd024.dedibox.fr 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.
Nov 12 08:27:08 sd024.dedibox.fr systemd[1]: Unit httpd.service entered failed state.

感谢您的帮助


httpd 日志:

[Wed Nov 12 10:51:08.003271 2014] [ssl:warn] [pid 22968:tid 140503118493760] AH01909: www.example.com:8081:0 server certificate does NOT include an ID which matches the server name 
[Wed Nov 12 10:51:08.003428 2014] [suexec:notice] [pid 22968:tid 140503118493760] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) 
[Wed Nov 12 10:51:08.003443 2014] [core:emerg] [pid 22968:tid 140503118493760] (28)No space left on device: AH00023: Couldn't create the rewrite-map mutex AH00016: Configuration Failed

答案1

该问题实际上并不是由于磁盘空间不足而引起的,而是由于信号量不足而引起的。

http://major.io/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/了解更多信息。

非常感谢你的帮助

答案2

确保 httpd.conf 文件中没有输入任何错误

之后重启服务

服务 httpd 重启

答案3

当我从使用手动 Apache 2.4 启动和重启切换到通过 systemctl 启用启动和重启时,我遇到了这个问题。我从未遇到过空间问题,但结果却是信号量。

关键在于这一行:

Main PID: 18796 (code=killed, signal=KILL)

当我使用

httpd -k start

一切正常。但是,当我在 systemctl 中启用该服务时,信号量被锁定。

我按照此处的说明进行了修复:什么是信号量以及如何为 Apache 清除信号量

另外,这里有一个用于清除信号量的 cron 脚本:自动清除信号量的脚本

相关内容