无法启动 redhat httpd 服务

Posted

技术标签:

【中文标题】无法启动 redhat httpd 服务【英文标题】:Not able to start redhat httpd service 【发布时间】:2022-01-13 09:45:27 【问题描述】:

当我尝试启动 httpd 服务时,它失败并出现错误:

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

journalctl -xe 的输出

  The result is failed.
    Dec 08 04:09:49 uls-**** systemd[1]: Unit httpd.service entered failed state.
    Dec 08 04:09:49 uls-******** systemd[1]: httpd.service failed.
    Dec 08 04:09:49 uls-******** sudo[67525]: pam_unix(sudo:session): session closed for user root
    Dec 08 04:09:49 uls-******** polkitd[854]: Unregistered Authentication Agent for unix-process:67526:3062933569 (system bus name :1.159161, object path /org/
    Dec 08 04:10:01 uls-******** systemd[1]: Started Session 78106 of user root.
    -- Subject: Unit session-78106.scope has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-78106.scope has finished starting up.
    --
    -- The start-up result is done.
    Dec 08 04:10:01 uls-******** systemd[1]: Started Session 78107 of user root.
    -- Subject: Unit session-78107.scope has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-78107.scope has finished starting up.
    --
    -- The start-up result is done.
    Dec 08 04:10:01 uls-******** CROND[67561]: (root) CMD (/usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log)
    Dec 08 04:10:01 uls-******** CROND[67562]: (root) CMD (/usr/lib64/sa/sa1 1 1)
    Dec 08 04:20:01 uls-******** systemd[1]: Started Session 78109 of user root.
    -- Subject: Unit session-78109.scope has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-78109.scope has finished starting up.
    --
    -- The start-up result is done.
    Dec 08 04:20:01 uls-******** systemd[1]: Started Session 78108 of user root.
    -- Subject: Unit session-78108.scope has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-78108.scope has finished starting up.
    --
    -- The start-up result is done

.

systemctl status httpd.service 的输出

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2021-12-08 04:26:51 PST; 53s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 68719 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 68719 (code=exited, status=1/FAILURE)

我试图更改 httpd.conf 文件中的端口号。但我得到了同样的错误。有人可以帮忙吗?

【问题讨论】:

【参考方案1】:

尝试检查您的配置,从命令 apachectl configtest 验证

【讨论】:

已验证且语法正常 运行这个 sudo journalctl -u httpd.service --since today --no-pager 并查看日志文件夹 /var/log/apache2/error.log 谢谢。我验证了日志并了解到某些证书已过期。这导致了问题。

以上是关于无法启动 redhat httpd 服务的主要内容,如果未能解决你的问题,请参考以下文章

Windows 上的 Apache httpd 服务器无法启动

Apache (httpd) 无法启动,因为“无法打开错误日志”

无法在 laragon 上启动服务 apache

httpd服务如何开机启动

XAMPP配置httpd-vhosts.conf后无法启动

wamp下部署ssl,https,httpd.conf,Apache无法启动,不能启动