apache,httpd服务启动报错解决方法

文章目录

声明

报错如图:
在这里插入图片描述
[root@control ~]# systemctl start httpd Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

  • httpd服务启动可能报错原因各有不同,但无论是什么原因导致的,不要慌,要学会看日志,日志一般都有详细提示。

解决步骤

启动报错的时候下面会提醒你输入 systemctl status httpd.service 或 journalctl -xe查看详细
在这里插入图片描述
对别人有没有帮助不知道,反正对我而言,这两项中的信息没有什么参考意义:
在这里插入图片描述
去看日志,日志中有详细说明,go

  • cd /var/log
  • tail -f messages
    简单说明一下:messages是系统日志,启动报错这里会有提示,tail -f 是动态查看的意思
    在这里插入图片描述
    现在重新打开一个窗口,重启或启动httpd服务:systemctl restart httpd ,然后回到日志窗口看最新日志
    在这里插入图片描述
    上图中看到 说配置文件中 /etc/httpd/conf/httpd.conf中265行错误,所以,现在打开文件,定位到265行
    在这里插入图片描述
    问题定位到了,把265行注释掉,重启试试
    在这里插入图片描述
    启动服务:systemctl start httpd , 成功
    在这里插入图片描述
  • 说明一下,我之前以为把配置文件改了重启就会报错,然而发现配置文件不是关键,而是 mod_wsgi 服务,我把mon_wsgi卸载以后重启就报错了,把 mon_wsgi装上以后就重启正常了,这里这么做,只是 测试 如何看日志 以及 如果通过日志 处理报错问题。
    在这里插入图片描述
  • wsgi 正确路径建议指定如下图哦:
    在这里插入图片描述
发布了67 篇原创文章 · 获赞 32 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/cuichongxin/article/details/103920525