Trouble writing to volt dir on CentOS 7 with SELinux in home dirs

Been setting up some servers over the last few days and have run into a strange problem. SELinux is denying access to the volt cache directory for /home/user/www/domain.co.uk/backend/cache/volt. The below is in the audit log from SELinux:

type=AVC msg=audit(1413053033.813:3210): avc: denied { write } for pid=20856 comm="httpd" name="volt" dev="dm-0" ino=54358309 scontext=systemu:systemr:httpdt:s0 tcontext=unconfinedu:objectr:httpdusercontentt:s0 tclass=dir

The directory (and subdirs) /home/user/www/domain.co.uk have the context "httpdusercontent_t" but Volt is still failing to compile files.

Anyone else been able to get to the bottom of this issue?

UPDATE: Found something similar in SO about this but I've already done those mentioned steps and yet compileFile() is still getting permission denied. - http://stackoverflow.com/a/25687421

I've also tried moving these out of home dirs with no change.



34.7k
edited Oct '14

you should chown directory to be webserver, for example if you running web service is nginx

    chown nginx:nginx -R /home/user