晴 13°
一觉到天亮,精神饱满,很久没有这样了。
1、创建用户
htpasswd -m /etc/svn-auth-users java1
htpasswd -m /etc/svn-auth-users java2
htpasswd -m /etc/svn-auth-users ios1
htpasswd -m /etc/svn-auth-users ios2
htpasswd -m /etc/svn-auth-users android1
htpasswd -m /etc/svn-auth-users android2
htpasswd -m /etc/svn-auth-users boss
htpasswd -m /etc/svn-auth-users tangyu
2、创建访问控制的控制文件
名字随便取,设计好有哪些组需求,权限如何,比如我们公司有java,ios、android
我可以分为4个组,除了上面三个组,老板肯定需要访问得到每一个组,再建立一个admin组,我自己为了工作方便,肯定也加到admin里面O(∩_∩)O
vim /etc/svn-access-control
[groups]
admin = boss,tangyu
java = java1,java2
ios = ios1,ios2
android = android1,android2
[/]
* = r
@admin = rw
[java:/]
@java = rw
[ios:/]
@ios = rw
[android:/]
@adnroid = rw
3、编辑svn配置文件
vim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user
</Location>
加入如下配置
AuthzSVNAccessFile /etc/svn-access-control
总体配置:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
AuthzSVNAccessFile /etc/svn-access-control
Require valid-user
</Location>
4、重启
service httpd restart