httpd.service的作业失败

按照这个教程: https : //www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-apache-for-centos-7

我已经尝试了一切可能的方法来修复错误,我已经通过了这些步骤来确保我正确地input了详细信息

我得到了这一点:

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,但它们是:/

关键错误消息似乎是:

SSLCertificateFile: file '/etc/httpd/ssl/apache.srt' does not exist or is empty

这可能是/etc/httpd/conf.d/ssl.conf中证书的SSL公钥组件名称中的一个小错字,很可能它应该是apache。 rt而不是apache。 s rt