Selinux下httpd端口的设置
Selinux下端口的设置(1)yum install httpd -y ##安装服务systemctl start httpd ##开启服务此时Selinux状态为:Enforcing(2)netstat antlupe | grep httpd##查看httpd端口为80(3)vim /etc/httpd/conf/httpd.conf...
·
Selinux下端口的设置
(1)
yum install httpd -y ##安装服务
systemctl start httpd ##开启服务
此时Selinux状态为:Enforcing
(2)netstat antlupe | grep httpd ##查看httpd端口为80
(3) vim /etc/httpd/conf/httpd.conf
Listen 8080 ##修改端口为8080 (已认证存在的端口)
systemctl restart httpd.service
netstat -antlupe | grep httpd ##查看端口为8080
(4) netstat -antlupe | grep 8888 ##随意设定的端口,查看不存在
vim /etc/httpd/conf/httpd.conf
Listen 8888
systemctl restart httpd.service
##重启服务失败
(5)更改Selinux状态
setenforce 0
systemctl restart httpd.service ##重启服务成功
##重新查看端口为8888
netstat -antlupe | grep 8888
netstat -antlupe | grep httpd
(2)netstat antlupe | grep httpd
(3) vim /etc/httpd/conf/httpd.conf
(4) netstat -antlupe | grep 8888 不存在非标准端口
vim /etc/httpd/conf/httpd.conf
(5)
######apache采用非标准端口,例如添加端口8888
增加selinux中的http端口
打开Selinux 状态
setenforce 1
getenforce
Enforcing
semanage port -a -t http_port_t -p tcp 8888
semanage port -l | grep http
详解:
-l 查询
-a 增加
systemctl restart httpd.service
netstat -antlupe | grep http
更多推荐
已为社区贡献1条内容
所有评论(0)