Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Working with Centos 7 and SELinux
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=4491
Page 1 of 1

Author:  mark [ 24. Nov 2017, 22:09 ]
Post subject:  Working with Centos 7 and SELinux

I have httpd installed, up and running.

After copying twg24 into /var/www/html I did the following
chown -R apache:apache /var/ww/html/twg24
chmod -R 777 xml/ cache/ counter/

Still I got "Unwriteable" for the 3 dirs in info.php!!

Issue:SELinux seems to have some rules/policies that applies to files/directories on top of the unix file permissions structure.

Run following
sudo chcon -t httpd_sys_content_t /var/www/html/twg24/ -R
sudo chcon -t httpd_sys_rw_content_t /var/www/html/twg24/cache/ -R
sudo chcon -t httpd_sys_rw_content_t /var/www/html/twg24/counter/ -R
sudo chcon -t httpd_sys_rw_content_t /var/www/html/twg24/xml/ -R
sudo chcon -t httpd_sys_rw_content_t /var/www/html/twg24/admin/_config/.htusers.php -R

Restart httpd and try again, to check info.php, and you will see green on these 3 dirs.

Thanks to https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/

Author:  TinyWebGallery [ 25. Nov 2017, 00:07 ]
Post subject:  Re: Working with Centos 7 and SELinux

Thanks for sharing this. Hope this helps other user as well,

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/