SVN 设置多库浏览
使用SVNParentPath的时候,直接访问ParentPath的时候,总是得到以下错误提示:
403 Forbidden
Forbidden
You don't have permission to access /svn/ on this server.
下面的办法可以搞定它:
我们在/data/svnroot/repository 下建立多个版本库是,想通过http://localhost.com/svn/ 查看其中的版本库列表,需要做以下工作,其中修改httpd.conf 中的选项:
DAV svn
SVNListParentPath on #允许通过http://localhost.com/svn/ 方式浏览版本库列表
SVNPathAuthz off
SVNParentPath /data/svnroot/repository #SVN 多库模式
Options Indexes MultiViews
Order allow,deny
allow from all
AllowOverride None
AuthBasicProvider ldap file #优先选择ldap做用户认证,不存在则通过svn_auth_file 文件认证
AuthType Basic
AuthzLDAPAuthoritative off
AuthName "Subversion repository"
AuthLDAPURL "ldap://ldap.localhost.com:389/dc=asiainfo,dc=com?sAMAccountName?sub?(objectClass=*)"
AuthLDAPBindDN "svn@localhost.com" #LDAP查询用户
AuthLDAPBindPassword passwd #LDAP查询用户密码
Satisfy Any
Require valid-user
SVNIndexXSLT "/svnindex.xsl" #SVN 浏览器中格式化样式表
AuthzSVNAccessFile /etc/httpd/conf.d/svn_access_file #SVN权限控制文件
AuthUserFile /etc/httpd/conf.d/svn_auth_file #SVN 用户密码文件
RedirectMatch ^(/svn)$ $1/
注意 中svn 后面的“/”是必须的,否则用http://localhost.com/svn/ 方式浏览时会提示无权限。
RedirectMatch ^(/svn)$ $1/ 是为解决用 http://localhost.com/svn 方式浏览,否则可能无法浏览。