2

How can I setup write access policies for an SVN repository under Apache2 on Windows Server 2008? Please help. TIA!

Update1:

I have next configuration already:

<Location /svn>
   SVNParentPath "E:\SVN"

   DAV svn
   SVNListParentPath on
   AuthType Basic
   AuthName "Subversion repositories"
   Require valid-user

   AuthUserFile svn-auth.txt
   #AuthzSVNAccessFile svn-acl.txt
</Location>

File D:\Program Files (x86)\Apache 2.2\svn-auth.txt created with htpasswd and looks like this:

foobar:$apr1$cV5.....$iwiJXkY6qlKopphUxlPMM/

All works fine.

File D:\Program Files (x86)\Apache 2.2\svn-acl.txt looks looks this:

[groups]
full = foobar

[/]
@full = rw
* = r

And when I uncommented AuthzSVNAccessFile svn-acl.txt I got

403 Forbidden
You don't have permission to access /svn/ on this server.

Here is an error.log record:

The URI does not contain the name of a repository.  [403, #190001]

I need next directories hierarchy:

E:\SVN is a root directory for all repositories - I want to list the all. It contains E:\SVN\test - is a project repository.

and E:\SVN\foobar - is a sub-root directory containing E:\SVN\foobar\foo and E:\SVN\foobar\bar - project repositories.

abatishchev
  • 531
  • 1
  • 9
  • 31
  • can you remove "SVNListParentPath on" from your config and try to access it again + post error result if it still does not work? – pQd Dec 22 '09 at 19:00
  • can you list files you've got in e:\svn ; can you check if user under which apache runs has full access to the files? ; can you paste your config file again ; just for testing - can you put instead of and use in the svn client http://localhost/svn2/ [ with the slash at the end ] – pQd Dec 22 '09 at 19:27
  • aa - and for checking - just use the web-browser. not svn client. – pQd Dec 22 '09 at 19:28
  • @pQd: All configurations work perfectly without specifying AuthzSVNAccessFile. http://localhost/svn/ lists directories of e:\svn. Changing Location in conf to svn2 moves it to http://localhost/svn2/. Without file works fine, with - error 403 – abatishchev Dec 22 '09 at 19:31
  • ok, but change just Location to /svn2 ; restart apache ; try with msie http://localhost/svn2/ [ exactly like that! ], and provide the error log. – pQd Dec 22 '09 at 19:41
  • a yeah - and pls use SVNPath NOT svnparentpath and report the result. – pQd Dec 22 '09 at 19:42
  • Oh! o_O Works! SVNPath to specific repository works! under /svn2 or /svn. Thanks!! But obsoletely incomprehensible! How can I allow directory listing with SVNParentPath? – abatishchev Dec 22 '09 at 19:52
  • well - describe what's your objective. multiple repositories? – pQd Dec 22 '09 at 20:08
  • I want /svn pointing e:\svn and listing all directories there - each is a repository. I want to grant everyone RO, and specific group RW to all repositories. – abatishchev Dec 22 '09 at 20:12
  • Maybe I should not configure /svn as DAV? And should just as a directory with allowed listing? – abatishchev Dec 22 '09 at 20:18
  • in fact i've never used such setup - so i cannot really advice how to approach it. if you have small number of repositories - just make static html page with choice of them and put separate for each. ugly... but will work. – pQd Dec 22 '09 at 20:33
  • Yea, it's easy but ugly.. I have a solution like this on my IIS7+DAV and ftp web acces. But there all directories are virtual. And here - real, under e:\svn so I'm looking for correct solution – abatishchev Dec 22 '09 at 20:38
  • can you post whole apache vhost config? is e:\svn also documentroot? – pQd Dec 22 '09 at 21:06
  • The rest of config is default. Nothing more. Only a number of Locations for SVN. DocumentRoot with /htdocs/ as a stub. Everything goes under virtual /svn directory – abatishchev Dec 22 '09 at 21:21
  • hm.. try adding slash after your svn in Location - change it to ... does it help? – pQd Dec 22 '09 at 21:50
  • [ via http://www.svnforum.org/2017/viewtopic.php?t=6443 ] – pQd Dec 22 '09 at 21:51
  • Fantastic!! It works!! Thanks!! Please post as a separate answer - I'll accept it. – abatishchev Dec 22 '09 at 21:53
  • perheps we should cleanup all the comment mess – pQd Dec 22 '09 at 22:26
  • hmm.. I don't think it's really necessary. But if you do - ok, no problem – abatishchev Dec 23 '09 at 10:02

2 Answers2

2

to set up anonymous read-only svn access put in your vhost config for apache:

<Location /svn>
    DAV svn
    SVNPath /somewhere/svn
    <LimitExcept GET PROPFIND OPTIONS REPORT>
        Order deny,allow
        Deny from all
    </LimitExcept>

svn with authentication / write access restrictions - take a look here.

you can find more details in the 'version control with subversion', in this chapter.

pQd
  • 29,561
  • 5
  • 64
  • 106
  • Thanks! I found some information already. But it doesn't work.. After I added AuthzSVNAccessFile svn-acl.txt login attempt returns 404 Forbiden. See more in my OP – abatishchev Dec 20 '09 at 21:03
  • @abatishchev - did you tried putting full path to both txt files? what do you have in error.log of apache? – pQd Dec 20 '09 at 21:12
  • @dQd: sorry, what do you mean 'full path to box txt files'? What and where? – abatishchev Dec 22 '09 at 18:04
  • @abatishchev - i mean write in your apache full path to svn-auth.txt and svn-acl.txt ; and include here content of error.log [ probably in rootOfApach/logs/error.log ] – pQd Dec 22 '09 at 18:22
1

try adding slash after your svn in Location - change it from

<Location /svn> 

to

<Location /svn/> 

not really intuitive, found via this forum post.

pQd
  • 29,561
  • 5
  • 64
  • 106