The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.

3.7.5.3 Changing the Default File Type

Under some circumstances, you might need to change the default file type for a file system hierarchy. For example, you might want to use a DocumentRoot directory other than /var/www/html with httpd.

To change the default file type of the directory hierarchy /var/webcontent as httpd_sys_content_t:

  1. Use the semanage command to define the file type httpd_sys_content_t for the directory hierarchy:

    # /usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/var/webcontent(/.*)?"

    This command adds the following entry to the file /etc/selinux/targeted/contexts/files/file_contexts.local:

    /var/webcontent(/.*)?     system_u:object_r:httpd_sys_content_t:s0

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

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