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

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  #重新启动让其生效

你可能感兴趣的:(日常报错)