#查看selinux的端口
#添加端口
[root ~]# semanage port -a -t http_port_t -p tcp 84
如果没有semanage命令
-bash: semanage: command not found
则需要安装,安装命令
[root~]# yum -y install semanage
也可以选择关闭Selinux
1,临时关闭
[root~]# setenforce 0
2,永久关闭
[root@localhost ~]# vim /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
保存退出
#使配置立即生效
[root~]# setenforce 0
常见错误:
在启动Apache的时候报错:
Permission denied: AH00072: make_sock: could not bind to address [::]:84
是因为Selinux的安全策略引起的,为了主机的安全,它不允许访问不在它策略中指定的端口,按上述方法填加即可。