How to configure SVN web access for different write permissions?

后端 未结 3 1317
不思量自难忘°
不思量自难忘° 2020-12-18 09:18

I\'m trying to configure SVN web access on Apache2 under Windows Server 2008 for different write permissions.

I have next Apache2 conf:



        
相关标签:
3条回答
  • 2020-12-18 10:00

    SVNPath is for one repository, SVNParentPath is for a root directory containing several repositories. So you should remove your second location in the Apache configuration file because it conflicts with the first if you try to access http://<host>/svn/foobar.

    You should put absolute paths for the access and authentication files, make sure the Apache service has read/write access to the parent directory and all the repositories, and read access to those access and authentication files, it is often overlooked in manual installations.

    For example:

    <Location /svn>
        RedirectMatch ^(/svn)$ $1/
        SVNParentPath E:\SVN
    
        DAV svn
        SVNListParentPath on
        AuthType Basic
        AuthName "Subversion repositories"
        Require valid-user
    
        AuthUserFile C:\SVN\conf\svn-auth.txt
        AuthzSVNAccessFile C:\SVN\conf\svn-acl.txt
    </Location>
    

    You will find all the necessary information in Version Control with Subversion (this is the link to the latest version, though the Apache configuration settings haven't changed lately).

    Then you should be able to specify global or individual permissions for groups and users, for your repositories. Examples of that can be found here, with the name you gave:

    [groups]
    full = abatishchev, anotherguy
    main = abatishchev
    
    [/]
    * = r
    @full = rw
    abatishchev = rw
    
    [foobar:/]
    * =
    @main = rw
    full = r
    
    [otherproject:/]
    @main = rw
    full = r
    

    In this example, you have set general rules in [/], then particular rules that will prevail for foorbar (and everything below), and otherproject. You can even specify specific rules for individual directories of a repository.

    0 讨论(0)
  • 2020-12-18 10:07

    Changing Apache config

    <Location /svn>
    

    to

    <Location /svn/>
    

    fixes the problem of 403 error on directory listing

    0 讨论(0)
  • 2020-12-18 10:17

    This is not a direct answer to your question, and it is always great to learn stuff from the ground up as you are doing it now, but seeing as you're on a Windows machine I thought I'd mention VisualSVN server. It's a point-and-click, very nice to configure wrapper to the SVN binaries that provides a web access of its own as well.

    0 讨论(0)
提交回复
热议问题