I have a server with several users and would like to allow some of them to store webpages on it. Thus, I have created subdirectories of /var/www for them and configured my webserver accordingly.
However, I do not want them to be able to view any contents of a subdirectory within /var/www other than their own. How can I do this? If I set the rights of the top directory to user:www-data and the access rights to 760, I think it would be possible. But how can I ensure that each file or directory created within their directory uses the same user:group attributes?
Also, I'd like to be able to use git to deploy web page contents. I don't want to know any technical details on how to do this, but rather how I should organize the rights again. I use gitolite and each repository is stored under /var/lib/gitolite/repositories (the owner of the files is the git user). What is the best way to allow the git user to write to one of the web page directories while using the correct user:group information? Is this possible at all? How do you manage your /var/www access rights? How do providers do it?