SELinux and PhpBB3 and Centos 7

What do you have and what do you want?

Moderators: b1o, jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

SELinux and PhpBB3 and Centos 7

Postby viking60 » 17 Sep 2015, 18:40

I have been banging my head against the wall with a phpbb upgrade on a Centos 7 box. :wall:
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 :coffee_smile: and clearly the permissions were given,
But phpbb3 kept telling me that it did not have write permission. :berserkf

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 :idea: Centos 7 comes with SELinux set as enforced. So i edited /etc/sysconfig/selinux and changed SELINUX=enforcing to

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
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

Return to “Software”