如何调试SELinux

不念以下列要求为例,为大家演示一下如何调试SELinux

图片[1]-如何调试SELinux-编程社

配置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
喜欢就支持一下吧
点赞120 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    暂无评论内容