# semanage fcontext -a -t httpd_sys_rw_content_t /var/www/dirI know that fancy way of doing this is to type,I try to enable write to certain directory in /var/www/dir in SELinux way.Hi, I'm playing with my web server and found a strange incident.
After successfully added rw type to directory, I will type
# restorecon -rv /var/wwwIt works fine.But, when I name the very directory "/var/www/Dir" not "/var/www/dir"first command works fine and I could see by
# semanage fcontext -l |grep "/var/www"The rw type is set allright.BUT, when I restorecon the /var/www, nothing happens and with force option, no use.
Is this a bug on "semanage fcontext" or my box is broken?My solution now is just name the directory "/var/www/dir" and post this question.Thanks.
[root@xxxx]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
[root@xxxx]# rpm -qa|grep selinux
selinux-policy-3.12.1-119.fc20.noarch
libselinux-2.2.1-6.fc20.x86_64
libselinux-utils-2.2.1-6.fc20.x86_64
selinux-policy-targeted-3.12.1-119.fc20.noarch
libselinux-python-2.2.1-6.fc20.x86_64
php-pecl-selinux-0.3.1-12.fc20.x86_64
libselinux-devel-2.2.1-6.fc20.x86_64
--