apache+svn配置:网络上一大把。
按照网络上的配置:
<Location /svn>
DAV svn
SVNParentPath /home/svnadmin/repos
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svnusers
require valid-user
</Location>
apache启动后,一切正常。访问:http://localhost/svn。登陆,权限验证正常,但是报出:403 Forbidden
You don't have permission to access /svn on this server.
用http://localhost/svn/repository访问 OK。
找了一下午的问题,为什么不能/svn的形式访问。把SVNParentPath的路径指向具体的repository(库),也无效。
继续搜索,原来,此处的SVNParentPath是支持多库类型,访问的时候只能http://localhost/svn/repository的方式访问。
如果希望指向单一库,则需要配置根目录。如果本身就只有一个库的情况下,就大可不用SVNParentPath。
直接用SVNPath即可。
如:
<Location /svn>
DAV svn
SVNPath "C:/svn/repository"
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile "C:/svn/svn_auth_file"
AuthzSVNAccessFile "C:/svn/repository/conf/win7_anthz"
Require valid-user
</Location>
此处配置,在地址栏中输入http://localhost/svn。ok。