My reply bwlow is somewhat vague but I hope it will give you the necessary pointers for you to proceed to an effective sollution.
It's basically a two-part process: 1) setting default group ownership and 2) setting default permissions.
1) For having all new files and directories to be created on your
/srv/http be given the group-belonging
web-server:
Code:
chgrp web-server /srv/http
chmod g+s /srv/http
2) Concerning the default permissions for new files and directories, I guess the traditional way would be for you to go through
umask[1].
Were your "/srv/http" directory be in an unlikely FAT partition, you could mount it:
a) if a partition in itself:
Code:
mount [device] /srv/http -o umask=002
b) if a folder inside an already mounted partition:
Code:
mount --bind /srv/http/ /srv/http/
mount -o remount,umask=002 /srv/http
However, the FAT family of filesystems is rather outdated and it's unlikely you'll have them in any modern setup. You can still use umask though, but not as an option to mount, rather as the command itself.The line:
will set the subsequent creations of files and directories to that umask.
Hence, you could place that command in /etc/profile or /etc/bashrc to have them set for all users (or use ~/.profile or ~/.bashrc for each concerning user).
However, this would affect all operations in all directories, not only in your
/srv/http! It may or may not be what you want...
Also do note that any concerning user would be able to change that behaviour during their sessions.
[1]: umask=002 sets default directory permissions to 775 (rwxrwxr-x) and file permissions to 664 (rw-rw-r--). For an excelent article on umask check:
http://www.cyberciti.biz/tips/unders...lue-usage.html
Finally, on another thread here at the forums, someone asked a very similar question and there were mentions of alternatives to what I said above. You might want to check it out:
http://www.linuxquestions.org/questi...ectory-831340/