![图片[1]-如何调试SELinux-编程社](https://cos.bianchengshe.com/wp-content/uploads/2023/09/image-1.png?imageMogr2/format/webp/interlace/1/quality/100)
配置httpd在82端口上提供Web服务,满足以下要求:
- 在/var/www/html/下添加index.html文件
- 此Web服务器在系统启动时自动启动
- 确保SELinux保护机制运行在Enforcing模式
我们这里httpd服务是82端口,服务开启会报错,这时候我们就需要放行82端口。
[root@bianchengshe ~]# semanage port -a -t http_port_t -p tcp 82 #放行82端口
[root@bianchengshe ~]# systemctl restart httpd.service #重启httpd服务
[root@bianchengshe ~]# systemctl enable httpd.service #设置开机自启
[root@bianchengshe ~]# curl http://bianchengshe:82 #查看内容
hello bianchengshe
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容