Wednesday, December 16, 2015

SELinux: allowing write access to a directory for Apache user to get rid of "Directory not writable" errors

Apart from setting write permissions with chmod, the following SELinux label should be set for the directory to be writable by Apache:
unconfined_u:object_r:httpd_sys_rw_content_t:s0

For example:

chcon -R unconfined_u:object_r:httpd_sys_rw_content_t:s0 /var/www/html/your_directory

-R stands for "recursively" here.

No comments:

Post a Comment