I've set up a dedicated Subversion server with Apache and mod_dav_svn
on Ubuntu 9.10 Server, and I've got everything working fine at this point. However, I noticed that when it comes to assigning the right file permissions to the repository directory, most tutorials telll you to do something like this:
sudo chown -R www-data:www-data /svn/myrepo # make www-data the owner of the repo so Apache
# can write to it
sudo chmod -R g+ws /svn/myrepo # Give the www-data group write access as well, and enable
# setgid so that new directories have that group
Now, I did it a little differently. I created a new subversion
group, and made that the owner of the repository, then added myself and www-data
to that group, the reasoning being that this way I can edit the configuration files in /svn/myrepo/conf
and the hook scripts in /svn/myrepo/hooks
, and it also keeps Apache and Subversion a bit more separate from each other. I've seen other tutorials recommend something similar, but then tell you to do this:
sudo chwown -R www-data:subversion /svn/myrepo
sudo chmod -R g+ws /svn/myrepo
These same tutorials imply that you are creating the subversion
group specifically to keep Subversion and Apache mostly separate from each other, so why do they turn around and make www-data
the owner of the files? Is there any good reason to make www-data
the owner of the repository files at all? Why not just make root
the owner? It seems like keeping www-data
as the owner of the repository unnecessarily ties Subversion "too much" to Apache. Is there any good reason to make the owner www-data
instead of root
, as long as the group is still subversion
?