SELinux and PhpBB3 and Centos 7
Posted: 17 Sep 2015, 18:40
I have been banging my head against the wall with a phpbb upgrade on a Centos 7 box.
The install from phpbb did tell me that cache and several other directories could not be written to so I had to adjust the permissions.
That's easy so I chmoded the folders to 777 and I still got that message.
I chomed in Cli and in Thunar and listed with ls-l and a lot of other stuff
and clearly the permissions were given,
But phpbb3 kept telling me that it did not have write permission.
The phpbb forum had nothing on it either; they keep telling people to chmod to 777 - but that won't help. The situation I had was that everything was chmoded to 777 and still there were no write permissions.
Then it dawned on me
Centos 7 comes with SELinux set as enforced. So i edited /etc/sysconfig/selinux and changed SELINUX=enforcing to
Ahhh oh joy; at least my copy of this forum worked.
The update went through and I could turn SElinux back on again (as in "enforcing") after the upgrade.
It is also possible to leave SElinux on and make temporary changes for the files that need permission:
The install from phpbb did tell me that cache and several other directories could not be written to so I had to adjust the permissions.
That's easy so I chmoded the folders to 777 and I still got that message.
and clearly the permissions were given,But phpbb3 kept telling me that it did not have write permission.
The phpbb forum had nothing on it either; they keep telling people to chmod to 777 - but that won't help. The situation I had was that everything was chmoded to 777 and still there were no write permissions.
Then it dawned on me
Code: Select all
SELINUX=permissive
Ahhh oh joy; at least my copy of this forum worked.
The update went through and I could turn SElinux back on again (as in "enforcing") after the upgrade.
It is also possible to leave SElinux on and make temporary changes for the files that need permission:
Code: Select all
chcon -t httpd_sys_content_rw_t /var/www/html/forum/cache/
chcon -t httpd_sys_content_rw_t /var/www/html/forum/files/
chcon -t httpd_sys_content_rw_t /var/www/html/forum/store/
chcon -t httpd_sys_content_rw_t /var/www/html/forum/config.php
chcon -t httpd_sys_content_rw_t /var/www/html/forum/images/avatars/upload