![httpd.service 作业失败](https://linux22.com/image/657337/httpd.service%20%E4%BD%9C%E4%B8%9A%E5%A4%B1%E8%B4%A5.png)
我已尽一切可能修复错误,并已完成相关步骤以确保正确输入了详细信息
我到了这一点:
sudo apachectl restart
我一直收到这个错误。
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
我尝试重新启动 httpd 服务,但仍然出现同样的错误
执行后systemctl status httpd.service
我得到:
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Thu 2015-04-30 13:54:04 EDT; 2min 7s ago
Process: 30331 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 29403 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
Process: 30330 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 30330 (code=exited, status=1/FAILURE)
对于第二条命令journalctl -xn
我得到:
-- Logs begin at Thu 2015-04-30 07:01:51 EDT, end at Thu 2015-04-30 13:57:37 EDT. --
Apr 30 13:54:04 user sudo[30325]: user : TTY=pts/0 ; PWD=/home/user; USER=root ; COMMAND=/sbin/apachectl restart
Apr 30 13:54:04 user 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.
Apr 30 13:54:04 user httpd[30330]: AH00526: Syntax error on line 100 of /etc/httpd/conf.d/ssl.conf:
Apr 30 13:54:04 user httpd[30330]: SSLCertificateFile: file '/etc/httpd/ssl/apache.srt' does not exist or is empty
Apr 30 13:54:04 user systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 30 13:54:04 user kill[30331]: kill: cannot find process ""
Apr 30 13:54:04 user systemd[1]: httpd.service: control process exited, code=exited status=1
Apr 30 13:54:04 user 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.
Apr 30 13:54:04 user systemd[1]: Unit httpd.service entered failed state.
Apr 30 13:57:37 user sudo[30336]: user: TTY=pts/0 ; PWD=/home/user; USER=root ; COMMAND=/bin/journalctl -xn
-- Logs begin at Thu 2015-04-30 07:01:51 EDT, end at Thu 2015-04-30 13:57:37 EDT. --
Apr 30 13:54:04 user sudo[30325]: user: TTY=pts/0 ; PWD=/home/user; USER=root ; COMMAND=/sbin/apachectl restart
Apr 30 13:54:04 user 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.
Apr 30 13:54:04 user httpd[30330]: AH00526: Syntax error on line 100 of /etc/httpd/conf.d/ssl.conf:
Apr 30 13:54:04 user httpd[30330]: SSLCertificateFile: file '/etc/httpd/ssl/apache.srt' does not exist or is empty
Apr 30 13:54:04 user systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 30 13:54:04 user kill[30331]: kill: cannot find process ""
Apr 30 13:54:04 user systemd[1]: httpd.service: control process exited, code=exited status=1
Apr 30 13:54:04 user 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.
Apr 30 13:54:04 user systemd[1]: Unit httpd.service entered failed state.
Apr 30 13:57:37 user sudo[30336]: user: TTY=pts/0 ; PWD=/home/user; USER=root ; COMMAND=/bin/journalctl -xn
...skipping...
-- Logs begin at Thu 2015-04-30 07:01:51 EDT, end at Thu 2015-04-30 13:57:37 EDT. --
Apr 30 13:54:04 user sudo[30325]: user: TTY=pts/0 ; PWD=/home/user; USER=root ; COMMAND=/sbin/apachectl restart
Apr 30 13:54:04 user 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.
Apr 30 13:54:04 user httpd[30330]: AH00526: Syntax error on line 100 of /etc/httpd/conf.d/ssl.conf:
Apr 30 13:54:04 user httpd[30330]: SSLCertificateFile: file '/etc/httpd/ssl/apache.srt' does not exist or is empty
Apr 30 13:54:04 user systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 30 13:54:04 user kill[30331]: kill: cannot find process ""
Apr 30 13:54:04 user systemd[1]: httpd.service: control process exited, code=exited status=1
Apr 30 13:54:04 user 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.
Apr 30 13:54:04 user systemd[1]: Unit httpd.service entered failed state.
Apr 30 13:57:37 user sudo[30336]: user: TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/bin/journalctl -xn
IT 说文件不存在 etc/httpd/conf.d/ssl.conf 和 .key 但是它们确实存在 :/
答案1
关键错误信息似乎是:
SSLCertificateFile: file '/etc/httpd/ssl/apache.srt' does not exist or is empty
这可能是/etc/httpd/conf.d/ssl.conf
您的证书的 SSL 公钥组件名称中的一个小拼写错误,最有可能的是它应该是 apache。Crt 而不是 apache。s響