apache+svn权限管理实例

http://abc.scmlife.com/viewthread.php?tid=17700&highlight=
apache+svn权限管理实例
看了很多同学对权限管理的困惑,自己将实际操作方案放上来,供大家参考:
首先介绍下我们的环境:我们的SVN服务器是LINUX的操作系统

方法一
例子:
在服务器端192.168.2.22的/opt/repository下建test1和test2两个库,权限和用户文档统一
步骤如下:
1,建库
svnadmin create /opt/repository/test1
svnadmin create /opt/repository/test2

2,配置httpd
<Location /opt>
  DAV svn
  SVNParentPath /opt/repository/
  AuthType Basic
  AuthName "Subversion repository "
  AuthUserFile /opt/repository/passwd
  AuthzSVNAccessFile /opt/repository/authz
  Require valid-user
</Location>



解释:
用户访问test1的方式为:
http:// 192.168.2.22/opt/test1
用户访问test2的方式为:
http:// 192.168.2.22/opt/test2

3,则passwd 为用户列表文档
     authz 为用户权限管理文档

4,用户权限文档authz
在用户权限文档中,格式如下:

[groups]
t1=a
t2=b,c
t3=d,e

[test1:/]
*=r
@t1=rw
[test1:/back]
@t2=rw

[test2:/]
*=r
@t2=rw
[test2:/ca]
@t3=rw
@t1=none


解释:
对于test1库来讲:
1,        a具有所有目录的读写权限
2,        b,c对于back目录下的具有读写权限,对其他目录只有读权限
3,        d,e对所有目录只有读权限

对于test2库来讲:
1,        b,c具有所有目录的读写权限
2,        d,e对于ca目录具有读写权限,对其他目录只有读权限
3,        a 没有ca 目录的任何权限,但对其他目录有读权限



方法二:
例子:
在IP 地址为192.168.2.22的/opt/repository下建test1和test2两个库,权限和用户文档分开管理

步骤如下:
1,建库
svnadmin create /opt/repository/test1
svnadmin create /opt/repository/test2

2,配置httpd
<Location /test1>
  DAV svn
  SVNPath /opt/repository/test1
  AuthType Basic
  AuthName "Subversion repository test1"
  AuthUserFile /opt/repository/testconf/passwd1
  AuthzSVNAccessFile /opt/repository/testconf/authz1
  Require valid-user
</Location>

<Location /test2>
  DAV svn
  SVNPath /opt/repository/test2
  AuthType Basic
  AuthName "Subversion repository test2"
  AuthUserFile /opt/repository/testconf/passwd2
  AuthzSVNAccessFile /opt/repository/testconf/authz2
  Require valid-user
</Location>

解释:
用户访问test1的方式为:
http:// 192.168.2.22/test1
用户访问test2的方式为:
http:// 192.168.2.22/test2


注:<Location /test1>也可设成<Location  /opt/test1>
则相应访问方式可以为:http:// 192.168.2.22/opt/test1



3,则对于库test1来讲用户列表文档为/opt/repository/testconf/passwd1
                  权限文档为/opt/repository/testconf/authz1
对于库test2来讲用户列表文档为/opt/repository/testconf/passwd2
                  权限文档为/opt/repository/testconf/authz2

然后分别修改文件即可


我们目前实际操作用的是方法2,即各个库对应自己的权限文档。

希望对大家有点用。

转载请注明源自www.SCMLife.com,请保留版权. 本贴地址:http://abc.scmlife.com/viewthread.php?tid=17700

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值