Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

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.