Can't give write permission to apache?

Issues related to configuring your network
Post Reply
RadVolz
Posts: 2
Joined: 2017/04/16 15:17:52

Can't give write permission to apache?

Post by RadVolz » 2017/04/16 15:44:57

Hello,
So i'm configuring a file sharing called FileRun on centos 7, i followed all the steps in http://blog.filerun.com/how-to-install- ... -centos-7/ but when im at the step to install it through the browser, i got "Non-writable" status to /var/www/html/system/data/.
I already did chown -R apache:apache /var/www/html/ but i dont know it still doesnt have write permission to these folder. i checked the user and group with egrep -iw --color=auto '^user|^group' /etc/httpd/conf/httpd.conf and the result is:
User apache
Group apache

But somehow php still doesnt get write permission to these folder. Am I missed something? or are there any workaround for this problem?

Thank You

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Can't give write permission to apache?

Post by aks » 2017/04/18 17:22:15

Could be an SELinux problem/ Use setenforce Permissive to set selinux in premissive mode. Try your application(s).then run setenforce Enforcing.
If it worked, then it's an selinux issue, if not, then it's something else.

RadVolz
Posts: 2
Joined: 2017/04/16 15:17:52

Re: Can't give write permission to apache?

Post by RadVolz » 2017/04/21 16:46:39

aks wrote:Could be an SELinux problem/ Use setenforce Permissive to set selinux in premissive mode. Try your application(s).then run setenforce Enforcing.
If it worked, then it's an selinux issue, if not, then it's something else.
Thanks for your answer asks, after disabling SELinux it worked fine, but how if its for a production server? i've turn the SELinux on again, and i think i have to turn off SELinux everytime i made change of the configuration through browser (apache user) and had to reboot the server. Is there any other solution other than changing the SELinux?

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Can't give write permission to apache?

Post by aks » 2017/04/21 17:05:38

You can get the source of the problem logged to auditd and then use the various tools to allow whatever you are doing (there is much help on the CentOS wiki and available on Google). Disabling SE is just not an option anymore.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't give write permission to apache?

Post by TrevorH » 2017/04/22 13:07:30

Run in permissive mode and that will generate audit log entries for all the things that would have been denied. Run the audit log through the procedure in the wiki to generate your own policy file. Read the text version of the policy file to make sure it's not doing something insane and if not, install the new policy module with semodule. http://wiki.centos.org/HowTos/SELinux
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply