linux启动apache提示xe,apache启动失败:Job for httpd.service failed because the control process exited with er...

今天小编在https网站改造时使用“systemctl httpd restart”命令Apache启动失败,输出了如下的错误信息:

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

0940f7c59a53f85160a0b3224d0269ca.png

因为小编的apache服务器之前启动是正常的,后来由于使用“yum install mod_ssl”命令安装apache ssl模块之后再启动httpd服务器就报了上述的错误,于是在网络上大量寻找资料,都没有解决。

后来仔细看了一眼上面的错误信息,发现了“See systemctl status httpd.service”这一句话,于是在控制台运行了“systemctl status httpd”命令,看到了如下这几个关键的错误内容:

[root@VM_219_180_centos conf]# systemctl status httpd

● httpd.service - The Apache HTTP Server

Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)

Active: failed(Result: exit-code) since Wed 2018-05-23 16:31:04 CST; 13s ago

Docs: man:httpd.service(8)

Process: 8267 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)

Main PID: 8267 (code=exited, status=1/FAILURE)

Status: "Reading configuration..."

May 23 16:31:04 VM_219_180_centos systemd[1]: Starting The Apache HTTP Server...

May 23 16:31:04 VM_219_180_centos httpd[8267]: AH00526: Syntax error on line 104 of /etc/httpd/conf.d/ssl.conf:

May 23 16:31:04 VM_219_180_centos httpd[8267]: SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist... empty

May 23 16:31:04 VM_219_180_centos systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE

May 23 16:31:04 VM_219_180_centos systemd[1]: Failed to start The Apache HTTP Server.

May 23 16:31:04 VM_219_180_centos systemd[1]: Unit httpd.service entered failed state.

May 23 16:31:04 VM_219_180_centos systemd[1]: httpd.service failed.

Hint: Some lines were ellipsized, use -l to show in full.

错误解决:

从上面两行红色的字体可以看出提示,在“/etc/httpd/conf.d/ssl.conf”这个文件里面,有一行数据不存在,也就是“localhost.crt”这个名字的https证书不对,或者路径错误了,因此我们只需要检查ssl.conf这个配置文件里面的信息是否都正确了就可以了。

例如小编就将第二行红色部分改成了“SSLCertificateFile /etc/pki/tls/certs/2_www.tpyyes.com.crt”这样,再运行“systemctl httpd restart”命令重启apache就没有问题了。

注意:这个只是小编的解决方法,虽然都是显示的Apache启动错误(Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.),但是每个人的具体错误内容都是不一样的。

重要的是,我们要记得运行“systemctl status httpd”这个命令来查看我们的错误到底是什么!然后对症下药即可!!!

来源网站:太平洋学习网,转载请注明出处:http://www.tpyyes.com/a/linux/616.html

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值