简体   繁体   中英

apache web dav svn multiple repositories, one ACL file

I am having a really hard time trying to solve an issue I have with some apache configuration with web dav and authentication. I have several repositories and I want to use one single permissions (ACL) file. Is this even possible ? I get forbidden with my current setup. Here it is: My repos: /var/svn/repos/project_1

/var/svn/repos/project_2

/var/svn/repos/project_3

My apache configs:

< VirtualHost *:80>

    ServerName svn.mydomain.tld

    Redirect / https://svn.mydomain.tld/    

< /VirtualHost >

` LoadModule dav_module modules/mod_dav.so

LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module     modules/mod_dav_svn.so

LoadModule authz_svn_module   modules/mod_authz_svn.so

< VirtualHost *:443 >

ServerName svn.mydomain.tld

DocumentRoot "/var/www/svn"
    <Directory />
    Options Includes FollowSymLinks MultiViews
    </Directory>
SSLEngine on
SSLCertificateFile /path/to/the/cert
SSLCertificateKeyFile /path/to/the/key
SSLCACertificateFile  /path/to/the/cacert

<Location /project_1>
    DAV svn
    SVNPath /var/svn/repos/project_1
    SVNIndexXSLT "/repos-web/view/repos.xsl"
    SVNPathAuthz on
    AuthzSVNAccessFile /srv/svn/conf/svnaccess
    AuthType Basic
    AuthName "My SVN Repository"
    AuthUserFile /srv/svn/conf/svnusers
    Require valid-user
</Location>

<Location /project_2>
    DAV svn
    SVNPath /var/svn/repos/project_2
    SVNIndexXSLT "/repos-web/view/repos.xsl"
    SVNPathAuthz on
    AuthzSVNAccessFile /srv/svn/conf/svnaccess
    AuthType Basic
    AuthName "My SVN Repository"
    AuthUserFile /srv/svn/conf/svnusers
    Require valid-user
</Location>

<Location /project_3>
    DAV svn
    SVNPath /var/svn/repos/project_3
    SVNIndexXSLT "/repos-web/view/repos.xsl"
    SVNPathAuthz on
    AuthzSVNAccessFile /srv/svn/conf/svnaccess
    AuthType Basic
    AuthName "My SVN Repository"
    AuthUserFile /srv/svn/conf/svnusers
    Require valid-user
</Location>
</VirtualHost>

My ACL file "/srv/svn/conf/svnaccess" looks like this:

[groups]
gods = admin

[/]
@gods = rw
* = r

[project_1/]
joe = rw
* =

[project_2/]
ana = rw
* =

我终于通过使用“ SVNParentPath”而不是“ SVNPath”解决了这个问题,还在“ Location” project_name /末尾添加了斜杠,最后我不得不在我的ACL文件中使用“ [project_x:/]”格式以使这行得通。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM