社区电脑网络 → 浏览:帖子主题
* 帖子主题:安装 Linux Apache 启动报错 Job for httpd.service failed because the control process exited with error c 的解决方法
pojin (ID: 1)
头衔:论坛坛主
等级:究级天王[荣誉]
积分:1301
发帖:99
来自:保密
注册:2022-08-28 23:20:57
造访:2025-03-23 21:18:24
[ 第 1 楼 ] 回复
安装Linux Apache 启动报错的解决方法

报错现象:
[root@localhost ~]# 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.

解决方式:
1、使用journalctl -xe查看日志提示。
2、使用systemctl status httpd 查看Apache状态信息。
3、使用netstat -antlp |grep 80 查看80端口是否被占用。

此时查出问题所在。
[root@localhost ~]# netstat -antlp |grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 23917/nginx: master
tcp 0 0 192.168.1.130:52908 117.18.237.29:80 ESTABLISHED 23957/firefox
tcp 0 0 192.168.1.130:35046 8.43.84.214:80 FIN_WAIT2 -
tcp6 0 0 :::80 :::* LISTEN 23917/nginx: master

以上信息可以看到80端口被Nginx服务占用,此时有两种解决方式,如果不适用Nginx的情况下把占用80端口的Nginx服务kili掉即可。第二种是把Apache的端口该成别的端口。

[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80 //该成8080 即可  (输入 Listen 定位到位置)

然后重启httpd服务即可。
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable    (这步可以省略)

4、防火墙也放行即可
firewall-cmd --zone=public --add-port=8080/tcp --permanent



2022-11-11 14:33:40 IP:已设置保密
分页: 1, 共 1 页
快速回复主题
账号/密码
用户: 没有注册?密码:
评论内容