Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created the file svn.password and added a few users.

Now I installed a Subversion repository and a Trac instance to my apache folder and set up the vhost.conf as follows:

<Location /svn>
   DAV svn
   SVNParentPath /var/www/vhosts/xyz.com/svn/
   AuthType Basic
   AuthName "SVN"
   AuthUserFile /var/www/vhosts/xyz.com/svn.password
   Require valid-user
</Location>
<Location /trac/>
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler trac.web.modpython_frontend
   PythonOption TracEnv /var/www/vhosts/xyz.com/trac/
   PythonOption TracUriRoot /trac/
</Location>
<Location /trac/login>

All running smoothly, I can access http://www.xyz.com/svn/repository and http://www.xyz.com/trac/ with any of the users I have added.

Now here is my problem. I would now like to limit access to certain folders within my repository for certain users. I want one repository for Trac but certain developers will only work on certain projects. So basically there is a xyz_server folder and a xyz_client folder in my ./svn/repository/.

I now change /var/www/vhosts/xyz.com/svn/repository/conf/authz and set the following:

[/repository/xyz_server]
* =
test = rw
ihaveaccess = rw

[/repository/xyz_client]
ihaveaccess = rw

I would now assume, that if I try to access http://www.xyz.com/svn/repository/xyz_client/ with the user test it would not work. Only if I tried accessing http://www.xyz.com/svn/repository/xyz_server/ I should have read and write permissions.

However I have full access to the SVN folders.

What am I doing wrong?

share|improve this question

In your apache configuration, start by enabling mod_authz_svn module

LoadModule authz_svn_module modules/mod_authz_svn.so

Then inside <Location /svn> use the AuthzSVNAccessFile directive

AuthzSVNAccessFile /var/www/vhosts/xyz.com/svn/repository/conf/authz

share|improve this answer
    
I did so now, my vhosts.conf has the lines added, authz_svn_module was already loaded by default. However now no user has access anymore, I get a 403 Forbidden for all users. <Location /svn> DAV svn SVNParentPath /var/www/vhosts/xyz.com/svn/ AuthType Basic AuthName "SVN" AuthUserFile /var/www/vhosts/xyz.com/svn.password AuthzSVNAccessFile /var/www/vhosts/xyz.com/svn/repository/conf/authz Require valid-user </Location> – Jack Murphy Jun 18 '13 at 12:48

I had similar issues, but in the end the problem was not with the authentication settings on the SVN server, but with my SVN client "Tortoise" which had been caching authentication data. So in the OP's example, even if I logged in as user "test" through Tortoise, it would use the access rules for the previously logged in user "ihaveaccess". Clearing the authentication data under "TortoiseSVN --> Settings --> SavedData" worked for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.