centos运行httpd报错: httpd[5165]: (13)Permission denied: AH00072: make_sock: could not bind to address

本文详细解析了Apache服务启动时遇到的SELinux权限拒绝错误,并提供了两种解决方案:通过命令临时调整SELinux为宽容模式,或修改配置文件永久禁用SELinux,确保Apache服务正常运行。

1. 报错如下

Aug 12 10:11:01 localhost httpd[5165]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:8078
Aug 12 10:11:01 localhost httpd[5165]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:8078
Aug 12 10:11:01 localhost httpd[5165]: no listening sockets available, shutting down
Aug 12 10:11:01 localhost httpd[5165]: AH00015: Unable to open logs
Aug 12 10:11:01 localhost systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Aug 12 10:11:01 localhost kill[5167]: kill: cannot find process ""

2. 原因及解决

这是因为本机selinux而导致的错误,调整selinux状态即可,修改selinux的状态有两种方式,一种是命令方式,临时生效,一种是修改配置文件,永久生效

1)命令方式:调整至permissive

[root@localhost ~]# setenforce 0                  

2) 修改配置文件

[root@localhost ~]# vim /etc/selinux/config 
  7 SELINUX=enforcing #把enforcing改为disabled
[root@localhost ~]# reboot  #重新启动让其生效
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值