Last active
December 25, 2015 21:59
-
-
Save vandorjw/7046434 to your computer and use it in GitHub Desktop.
SELinux for /var/www and /var/virtualenvs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As root, set everything under /var/www to httpd_sys_content_t | |
(sh) # semanage fcontext -a -t httpd_sys_content_t "/var/www(/.*)?" | |
(sh) # restorecon -R /var/www/ | |
As root, set everything under /var/virtualenvs to lib_t | |
(sh) # semanage fcontext -a -t lib_t "/var/virtualenvs(/.*)?" | |
(sh) # restorecon -R /var/virtualenvs/ | |
If you want to apply this to a single file, just specify the file, and on restorecon, remove the "-R" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo semanage fcontext -a -t httpd_log_t "/var/sites/me/vandorjw/logs(/.*)?"
libsepol.mls_from_string: invalid MLS context None (No such file or directory).
libsepol.mls_from_string: could not construct mls context structure (No such file or directory).
libsepol.context_from_record: could not create context structure (Invalid argument).
libsemanage.validate_handler: invalid context system_u:object_r:httpd_log_t:None specified for /var/sites/ca/vandorjw/logs(/.*)? [ all files ](Invalid argument).
libsemanage.dbase_llist_iterate: could not iterate over records (Invalid argument).
ValueError: Could not commit semanage transaction
sudo semanage fcontext -a -t httpd_log_t -r s0 "/var/sites/me/vandorjw/logs(/.*)?"
Notice: -r s0