selinux未禁用导致httpd无法使用非80等默认端口

现象

修改httpd端口为9080,并启动提示如下:

[root@haifeng ~]# service httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:9080
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:9080
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

问题解决:

1、先不重启禁用selinux使用setenforce 0

2、设置配置文件/etc/selinux/config和/etc/sysconfig/selinux里面都禁用selinux,以后重启生效。

网友提示:

1、先是查看9080端口有没被其他程序占用 

#netstat -anpt | grep 9080,未被占用

2、查看权限问题,

3、查看selinux状态

#getenforce 状态为  Enforcing

可能是配置未生效,/etc/sysconfig/selinux里面配置是禁用,/etc/selinux/config这里是未禁用

注:getenforce/setenforce查看和设置SELinux的当前工作模式

这是关于httpd在selinux启用下运行在限制模式下,https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/chap-Managing_Confined_Services-The_Apache_HTTP_Server.html




转载于:https://my.oschina.net/maintenance/blog/155316

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值