Managing apache folder

The goal here is to allow apache process as well as multiple developers to have read and write permission to all apache files.

What I’m currently doing is:
– Add a new group “dev”

addgroup dev

– Add www-data (or whatever your apache runner user is) to the group “dev”

adduser www-data dev

– Add all developers to the group “dev”

adduser vincent dev
adduser anotherdev dev

– Change apache user “www-data” and all developers’ default group to “dev”

vim /etc/passwd
# each line is a user:
# username:x:userid:groupid:userinfo:script
# now change groupid from the default user group to the groupid of "dev"

– Change umask to 002 (all developers on ssh, all developers on sftp, and www-data)

vim /etc/profile
# change umask to 002
vim /etc/ssh/sshd_config
# change Subsystem to:
Subsystem sftp /usr/lib/openssh/sftp-server -u 0002
vim /etc/apache2/envvars
# add
umask 002

– Change all apache folders to www-data:dev, 775 and files to www-data:dev, 664

chown www-data:dev /home/www-data -R
chmod 775 /home/www-data
find /home/www-data/* -type d -exec chmod 775 {} \;
find /home/www-data/* -type f -exec chmod 664 {} \;

Leave a Reply