SFTP and Apache – Grant Write Permissions on Same Folders

apache-2.2centos6file-permissionspermissionssftp

I have a centos6 web server where developers also upload by connecting through SFTP. So, to give developer login write permissions, I have change /var/www user to that user. My current permissions are:
developer:root
and with these, SFTP developer login can upload files, but apache can't upload files in them even with 777 permissions. I even tried with setting permissions like developer:apache, but of no avail.

How would I give both Apache and SFTP login write permissions at the same time?

Best Answer

i would recommend you to use acls here:

setfacl -R -m user:apache:rwx directory
setfacl -R -d -m user:apache:rwx directory
setfacl -R -m user:developer:rwx directory
setfacl -R -d -m user:developer:rwx directory