I'm currently learning SELinux. I was following the instructions in SELinux doc of RedHat. I indeed succeded after typing the following commands:  mkdir /mywebsite  //add something to /mywebsite/index.html  semanage fcontext -a -t httpd_sys_content_t /mywebsite(/.*)?  restorecon -R -v /mywebsite //everythins worked well by thenBut I did something more afterwards:  chcon -R -t httpd_sys_content_t /mywebsite  //I can't access index.html now, as expectedrestorecon -R -v /mywebsite //Still can't access index.html!!  semanage fcontext -a -t httpd_sys_content_t /mywebsite(/.*)?  restorecon -R -v /mywebsite  //didn't work, eitherls -dZ /mywebsite // unconfined_u:object_r:httpd_sys_content_t:s0The error message in firefox is:  ForbiddenYou don't have permission to access /index.html on this server. Am I missing something? Or it is a bug? My OS is Fedora 20 with Apache 2.4.7.
Httpd can't access file even after setting httpd_sys_content_t
centos;fedora;selinux
My mistake. This is not SELinux's fault. The tutorial on red hat is not complete. We should also add the following to the httpd configuration file(for apache httpd 2.4):  <Directory /mywebsite>    AllowOverride None    # Allow open access:    Require all granted</Directory>