Originally asked on Drupal Stack Exchange but opening up since it may be a general Linux/Apache issue.
Need the internet to confirm my sanity. On a Drupal 7 site it's saying "The directory sites/default/files is not writable." So I checked every permission but I don't see the issue. Since this isn't a public server, I temporarily turned off SELinux. LAMP stack, CentOS 7.6, Apache 2.4.38 from @CodeIT, PHP 7.2.16. User 'apache' is in the groups 'apache web'. What am I missing?
ps aux | grep httpd output:
root 29064 0.0 0.1 262224 6492 ? Ss 18:26 0:00 /usr/sbin/httpd -DFOREGROUND apache 29065 0.0 0.0 261884 3672 ? S 18:26 0:00 /usr/sbin/httpd -DFOREGROUND apache 29066 0.0 0.2 1188648 10040 ? Sl 18:26 0:00 /usr/sbin/httpd -DFOREGROUND apache 29067 0.0 0.2 1778408 8000 ? Sl 18:26 0:00 /usr/sbin/httpd -DFOREGROUND
/sites/default/files is a symlink and the permission should be ignored
lrwxrwxrwx 1 root root 31 Mar 18 18:14 files -> /mnt/efs/website/publicfiles/
So let's go down the tree
drwxr-xr-x 12 root root 6144 Feb 17 23:27 efs
drwxr-xr-x 4 root root 6144 Feb 17 23:28 website
drwxrwxr-x 110 apache web 141312 Mar 18 18:16 publicfiles
FollowSymLinks also appears to be turned on in several places.
<Directory "/var/www/html"> Options Indexes FollowSymLinks </Directory> <VirtualHost *:80> ... server info ... <Directory "/var/www/html/website/public_html"> AllowOverride All Require all granted Options -Indexes +FollowSymLinks </Directory> </VirtualHost>
# Follow symbolic links in this directory. Options +FollowSymLinks
This still isn't solved and is driving me crazy. As specified above the
/mnt/efs/website/publicfiles dir was 775 owned by apache:web, where
apache is a member of the group
web. That wasn't working. Setting publicfiles to 777 of course works, so it isn't an SELinux issue.
ps aux is telling the user
apache is running my server how does it not have access to it's own group?