开发者社区 > 数据库 > 正文

centos无法启动httpd服务

已解决
关联开发者云场景 基于ECS搭建云上博客

httpd -v Server version: Apache/2.4.6 (CentOS) Server built: May 30 2023 14:01:11

输入: systemctl start httpd.service 反馈:Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

展开
收起
_风无影_ 2023-06-26 21:57:08 147 0
1 条回答
写回答
取消 提交回答
  • 推荐回答

    输入 httpd -v 后显示:

    Server version: Apache/2.4.6 (CentOS) Server built: May 30 2023 14:01:11

    然后输入: systemctl start httpd.service 显示:

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

    无法继续下一步。

    网上各种搜原因,终于找到:Apache 和 Nginx的端口 80 冲突了,导致失败。需要修改端口。

    所以在 httpd -v 和systemctl start httpd.service 中间加入这几步:

    vim /etc/httpd/conf/httpd.conf

    然后出来的页面找到 listen 80 改为 listen 8080

    (知识点:进入编辑模式: i (在当前位置插入,开始编辑);

    保存编辑文本: :w (英文冒号,保存当前编辑的文件);

    退出编辑文件: :q(英文冒号,退出当前编辑的文件);

    保存并退出: :wq (英文冒号,保存并退出当前编辑的文件);

    强制退出: :q! (英文冒号,强制退出不保存)。)

    然后按Esc,然后按:wq (好像也可以按Shift+zz 我忘了我是按哪个保存了)

    然后就可以正常按流程走下去了。

    但是后续的网址,记得要加上 :8080

    其他就参照教程来了。

    2023-06-26 22:57:49
    赞同 展开评论 打赏

数据库领域前沿技术分享与交流

相关电子书

更多
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载
低代码开发师(初级)实战教程 立即下载