当您添加或更改新规则到fcontext semanage到任何目录并应用时,egg:
# How to add this rule for apply changes whit restoreconf -Rv /var/www/html(/.*)?/media(/.*)? system_u:object_r:httpd_sys_rw_content_t:s0 # Here found all files have .bin and conf /etc/selinux/targeted/contexts/files
是否要应用的结果是使用平均httpd文件夹来写入和读取SELinux没有问题。
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/domain.com/media #restorecon -Rv not apply changes
您的问题似乎有点不完整,但从我收集的内容httpd_sys_rw_content_t您希望将httpd_sys_rw_content_t上下文应用于您的虚拟主机/域的所有media子文件夹及其中的所有内容。 这些命令应该为你做:
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/(.*)/media(/.*)?" restorecon -Rv /var/www/html
这应该在域文件夹中的所有媒体子文件夹上应用上下文types。