我正在使用mod_dav_svn设置一个svn服务器。 我想满足以下所有条件:
这是目前的configuration:
<VirtualHost *:80> ServerName repos.example.com <Location /> DAV svn AuthType Basic AuthName "Log In" AuthBasicProvider ldap AuthzLDAPAuthoritative off AuthLDAPURL ldap://*** AuthLDAPBindDN *** AuthLDAPBindPassword *** require valid-user SVNListParentPath on SVNParentPath /mnt/repos/svn SVNIndexXSLT /repo-style/svnindex.xsl AuthzSVNAccessFile /mnt/repos/svn-auth/access </Location> </VirtualHost>
上面的问题是,当一个请求进入repos.example.com/repo-admin mod_dav_svn答复说,存储库不存在。 我需要编写一个重写scheme,隔离该特定子目录的请求,并提供常规的HTML或PHP或其他任何东西。
我试图使用重写或别名来实现这一点,但一直没有成功。 任何input将不胜感激。
那么,如果我的问题是正确的,那么你有两个select:
第一个选项是为每个人授予读取文件的权限,但对于写入操作则需要授权用户。 configuration示例:
<Location /svn> DAV svn SVNParentPath /var/svn # Authentication type, name, etc. # Authorization: Authenticated users only for non-read-only # (write) operations; allow anonymous reads <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>
在这里了解更多: 毯子访问控制
第二个select是使用AuthzSVNAccessFile。 通过此选项,您可以拥有更灵活的每个目录和每个项目的访问configuration。 示例configuration:
[groups] admin = john, kate devteam1 = john, rachel, sally devteam2 = kate, peter, mark docs = bob, jane, mike training = zak # Default access rule for ALL repositories # Everyone can read, admins can write, Dan German is excluded. [/] * = r @admin = rw dangerman = # Allow developers complete access to their project repos [proj1:/] @devteam1 = rw [proj2:/] @devteam2 = rw [bigproj:/] @devteam1 = rw @devteam2 = rw trevor = rw # Give the doc people write access to all the docs folders [/trunk/doc] @docs = rw # Give trainees write access in the training repository only [TrainingRepos:/] @training = rw
在这里了解更多: AuthzSVNAccessFile如何工作?
根据这个关于在configuration中关于Apache 2部分的 位置合并顺序的问题 ,只有声明<Location /repo-style>可以覆盖声明的<Location />传递DAV svn 。
由于Directory指令不具有优先权,因此唯一的select是使用“ Location部分提供静态内容,例如感谢以您喜欢的脚本语言快速编写的CGI脚本。