Restoring the Default File Type
The following steps restore the default file type of the directory hierarchy
/var/webcontent
that has the httpd_sys_content_t
setting:
-
Use the semanage command to delete the file type definition for the directory hierarchy from the file
/etc/selinux/targeted/contexts/files/file_contexts.local
:sudo /usr/sbin/semanage fcontext -d "/var/webcontent(/.*)?"
-
Use the restorecon command to apply the default file type to the entire directory hierarchy.
sudo /sbin/restorecon -R -v /var/webcontent