1.修改svnserve.conf配置
debian:/doc/rel/svn/repository/spider/conf#svnserve.conf
去掉password-db = passwd这一行前面的注释和空格
去掉authz-db = authz这一行前面的注释和空格
2.密码文件使用spider/conf/passwd,创建密码的方式不变
3.目录权限设置
debian:/doc/rel/svn/repository/spider/conf#vim authz
[groups]
root = hello
group1 = user1
group2 = user2
[/]
@root = rw
@group1 = r
@group2 = r
[/project1]
@root = rw
@group1 = rw
@group2 =
[/project1]
@root = rw
@group1 =
@group2 = rw
保存!
root对/,/project1,/project2有完全权限
group1组成员user1对/有读权限,对/project1有读写权限,对/project2无读写权限
group2组成员user2对/有读权限,对/project1无读写权限,对/project2有读写权限
4.修改apache配置
debian:/etc/apache2/mods-available#vim dav_svn.conf
<Location /spider>
DAV svn
SVNPath /doc/rel/svn/repository/spider
AuthType Basic
AuthName "spider"
AuthUserFile /doc/rel/svn/repository/spider/conf/passwd
Require valid-user
AuthzSVNAccessFile /doc/rel/svn/repository/spider/conf/authz
</Location>
保存!
5.重启apache和svnserve,我目前还没有找到重启svnserve的好方法,只能笨拙的重启系统,这样顺便把apache也重启了
*6.如果系统提示没有加载mod_authz_svn或者mod_dav模块,可以检查apache的配置文件
debian:/etc/apache2/mods-available#vim dav.load
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
debian:/etc/apache2/mods-available#vim dav_svn.load
# Depends: dav
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so