windows下用WANdisco搭建svn服务器

来源:互联网 发布:苹果软件下载 编辑:程序博客网 时间:2024/05/21 02:53

一:安装

(1)进入http://subversion.apache.org/点击Binary Packages

选择windows下WANdisco后,点击下载版本后进入下载页面

根据提示填写信息(ps:邮箱一定要填写一个可用的),提交之后会发一封邮件到你的邮箱,文件中有下载地址,点击下载即可

(2)正式安装


其中Password File可以先不填(因为咱也没有),Repository Directory选个文件夹作为版本库,填完之后Install,,基本安装完成


二:版本库创建及配置

(1)创建版本库(对应的当然是之前填写的Repository Diretory)

安装的时候选了版本库文件夹,但这个文件夹并不是真正的版本库,所以我们来创建一下

在cmd命令框中输入svnadmin create G:\svn\repository


(2)创建密码文件(此文件也就是Password File)

在cmd命令框中输入htpasswd -c filename username

ps:文件在当前命令的位置输出,比如你在d:打的命令,那么文件就在d盘下;filename是输出文件的文件名,username为用户名

输入两次密码之后,文件创建成功(密码为123456,这为加密之后的)


(3)在创建好的版本库中修改配置参数(路径G:\svn\repository\conf\svnserve.conf)

auth-access = write     password-db = passwd     authz-db = authz     realm = myproject
auth-access = write #允许写入

password-db = passwd #访问时需要输入密码

auth-db = authz #访问权限设置

realm = myproject #版本库标识符(在权限配置文件中会用到)

(4)配置版本库权限控制文件(路径G:\svn\repository\conf\authz)

[groups]   admin =  harry,sally,lisq    [/]   @admin = rw     [myproject:/]   @admin = rw 
[groups] #配置用户组

格式为:  用户组名 = 用户名1,用户名2,用户名3

[/] #根目录及以下

格式为:@用户组名 = 权限

[myproject:/] #版本库权限(myproject就是之前在svnserve.conf中配置的版本库标识符)

格式为:@用户组名 = 权限

w:写权限    r:读权限

三:配置Subversion(之前保存的路径是D:\Subversion)

找到配置文件(D:\Subversion\Apache2\conf\subversion.conf)

<VirtualHost *:8888> KeepAlive On <Location /svn>  DAV svn  SVNParentPath G:\svn  # SVNParentPath and authz fix http://subversion.tigris.org/issues/show_bug.cgi?id=2753  RedirectMatch ^(/svn)$ $1/   AuthType Basic  AuthName "Subversion Repo"  # If you didn't specify a password file during installation the  # next line needs to be configured for user authentication.  AuthUserFile "G:\passwd"  AuthzSVNAccessFile "G:\svn\repository\conf\authz"  Require valid-user  Order allow,deny  Allow from all  SVNAutoversioning on </Location> # Enable Subversion logging CustomLog logs/subversion.log combined</VirtualHost>
AuthUserFile:密码文件的路径(之前创建的那个密码文件路径)

AuthzSVNAccessFile:权限控制文件的路径(之前版本库下配置好的authz文件路径)

至此,所有工作全部完成,启动svn服务器,连接测试下



0 0