Drupal - Drupal files folder owner/group for CentOS?

I faced with this issue before, it was because of SELinux on CentOS, So you should try to Disable SELinux on Centos

From the command line, you can edit the /etc/sysconfig/selinux file. This file is a symlink to /etc/selinux/config. The configuration file is self-explanatory. Changing the value of SELINUX or SELINUXTYPE changes the state of SELinux and the name of the policy to be used the next time the system boots.

[root@host2a ~]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=permissive
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0

Change it from SELINUX=permissive to SELINUX=disabled

Once you have saved the changes sudo shutdown -r now to restart now.


Also you can disable it temporary ( until next restarting ) with

sudo setenforce 0

How to Disable SELinux


In CentOS, Apache/HTTPD username is normally apache. During installation, apache user should have read-write access to sites/default directory.

After installation, apache user should have read-write access to the sites/default/files directory. Check Drupal Docs for more details on file permissions.

Note: If giving permissions doesn't help, make sure SELinux is disabled. Check @zhilevan's ans above.

Tags:

Files

7