I need to set selinux permissions on a non-default httpd directory: /www/virtualhosts/site01, ect.

So I issue:

[mybox]# semanage fcontext -a -t http_sys_content_t "/www(/.*)?"

And get:

ValueError: Type http_sys_content_t is invalid, must be a file or device type

What needs to happen to configure selinux to work with my non-default httpd directory?


You just need to fix your typo.

You entered:


But it is correctly:

  • What's the difference between httpd_sys_content_t and httpd_sys_rw_content_t? Should I give the same selinux permissions to the ssl certificate directory (again not the default)?
    – a coder
    Dec 18 '15 at 19:51
  • 1
    One is read only, one is read-write. Dec 18 '15 at 19:53
  • And, whenever possible, you should use the default directories. It will save you a lot of trouble later. Dec 18 '15 at 19:54
  • What is there a default ssl certificate directory in EL7?
    – a coder
    Dec 18 '15 at 19:55
  • 1
    The directories under /etc/pki/tls. Dec 18 '15 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.