更改/etc/httpd/conf/httpd.conf端口号80为81后
[root@localhost tool]# service httpd restart
停止 httpd:[确定]
正在启动 httpd:(13)Permission denied: make_sock: could not bind to address [::]:81 //许可被拒绝,不能绑定这个端口
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:81
no listening sockets available, shutting down
Unable to open logs
[失败]
[root@localhost tool]#
将端口更改为80可以正常启动。于是考虑到安全方面的权限问题,首先看SELINUX
[root@localhost tool]# getenforce
Enforcing //已开启
[root@localhost tool]# setenforce 0 //暂时关掉它
[root@localhost tool]# getenforce
Permissive
root@localhost tool]# service httpd start
正在启动 httpd:[确定] //可以正常启动。于是确定是SELINUX的安全问题。但这种关闭的方法实在不是安全的选择。那就要考虑如何设置它的权限。
[root@localhost tool]#
思路:
首先查找make_sock相关的文件,查看是否这个文件的SE安全问题。但并没有找到这个文件。于是上网求助。搜索Permission denied: make_sock: could not bind to address关键字。结果查到以下信息:
semanage port -l|grep http
semanage port -a -t http_port_t -p tcp 81