3.7.5.4 Restoring the Default File Type

To restore the default file type of the directory hierarchy /var/webcontent after previously changing it to httpd_sys_content_t:

  1. 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:

    # /usr/sbin/semanage fcontext -d "/var/webcontent(/.*)?"

  2. Use the restorecon command to apply the default file type to the entire directory hierarchy.

    # /sbin/restorecon -R -v /var/webcontent