1

As you add or change a new rule to fcontext semanage to any directory and apply, egg:

# How to add this rule for apply changes whit restoreconf -Rv
/var/www/html(/.*)?/media(/.*)?   system_u:object_r:httpd_sys_rw_content_t:s0
# Here found all files have .bin and conf 
/etc/selinux/targeted/contexts/files

The result on whether you want to apply is to use the average httpd folder to write and read without problems with SELinux.

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/domain.com/media
#restorecon -Rv not apply changes
Colpaisa
  • 23
  • 4

1 Answers1

3

Your questions seems a little bit incomplete, but from what I gather you want to apply the httpd_sys_rw_content_t context on all media subfolders of your vhosts/domains and everything within it. These commands should do that for you:

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/(.*)/media(/.*)?"
restorecon -Rv /var/www/html

This should apply the context type on all media subfolders in your domain folders.

Oldskool
  • 2,025
  • 1
  • 16
  • 27