免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3048 | 回复: 1
打印 上一主题 下一主题

http+nfs 在selinux中网站目录属性的设置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-09 22:36 |只看该作者 |倒序浏览
我的配置及报错信息如下:
[root@www ~]#vi /etc/exports
/html           192.168.1.0/24(ro)
[root@www ~]# service portmap start
[root@www ~]# service nfs start
[root@www ~]# vi /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
    DocumentRoot "/www"
    ServerName vhost.test.com
    ErrorLog /var/log/httpd/vhost.test.com-error_log
    CustomLog /var/log/httpd/vhost.test.com-access_log combined
</VirtualHost>
[root@www ~]# mount 192.168.1.101:/html /www
[root@www ~]# service httpd start
[root@www ~]# service httpd start
Starting httpd: Warning: DocumentRoot [/www] does not exist
                                                           [  OK  ]
[root@www ~]# tail /var/log/messages

Jul  9 22:03:49 www kernel: audit(1247148229.853:12): avc:  denied  { getattr } for  pid=5916 comm="httpd" path="/www" dev=0:16 ino=946562 scontext=root:system_r:httpd_t:s0 tcontext=system_u: object_r:nfs_t:s0 tclass=dir

[root@www ~]# ls -Z /www/ -d
drwxr-xr-x  root root system_u: object_r:nfs_t:s0       /www/
[root@www ~]# chcon --reference=/etc/httpd/ /www/
chcon: failed to change context of /www/ to system_u: object_r:httpd_config_t:s0: Operation not supported

请问怎么样才能更改 /www的selinux 属性呢?谢谢指导!

[ 本帖最后由 eaglegirl 于 2009-7-9 22:37 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2010-04-19 12:08 |只看该作者
semanage fcontext -a -t  httpd_sys_content_t  /www
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP