This is my first time installing Drupal on CentOS. I know for Ubuntu it needs to be www-data
as the /files folder owner, but what is it for CentOS?
2 Answers
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
-
OMG, big thank you. I've been going around in circles for 2 hours. Commented Dec 19, 2016 at 12:35
-
For future readers: You still need
apache
as owner/group as per @yogesh answer Commented Dec 19, 2016 at 12:38 -
1@NoSssweat you're welcome my friend, I remember I spend some hours to find this solution and now I transmit it to you. 😊😊. we are here to help each others.– YuseferiCommented Dec 19, 2016 at 12:40
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.
-
I changed it to apache and even gave it 777 (for testing purposes) and still getting the same file system error. Commented Dec 19, 2016 at 11:37
-
Did you tried with 'Proceed with the installation' or just refreshed the page?– YogeshCommented Dec 19, 2016 at 11:43
-
If giving permissions to
sites/default
directory doesn't work, then try creatingfiles
directory andsettings.php
file inside it and giving these permissions. That should work– YogeshCommented Dec 19, 2016 at 11:44 -
I did that while the settings file error is now gone, the file system error is still showing up. Commented Dec 19, 2016 at 11:49
-