SELinux with Apache / PHP
You have symlink your webapp to /var/www/ but still permission denied. Because file context is still not acceptable by selinux
To list context of folder or file (add -Z):
ls -Z ~khad/workspace/webapp/
To set file or folder read only, but apache can access:
chcon -R -t httpd_sys_content_t ~khad/workspace/webapp/
To set file or folder read and write, but apache can access:
chcon -R -t httpd_sys_rw_content_t ~khad/workspace/webapp/temp/
To allow connect network and database:
#setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1
To list context of folder or file (add -Z):
ls -Z ~khad/workspace/webapp/
To set file or folder read only, but apache can access:
chcon -R -t httpd_sys_content_t ~khad/workspace/webapp/
To set file or folder read and write, but apache can access:
chcon -R -t httpd_sys_rw_content_t ~khad/workspace/webapp/temp/
To allow connect network and database:
#setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1
Comments