使用版本管理服务器,不仅仅是一个文件服务器,还能记录并随时恢复每一次改变,对于团队开发自然是必不可少的,对个人使用也能提供很多方便。针对个人或小团队开发的情况,不需要复杂的配置,几步简单的安装和设置,svn就可以就位了,本文记录的就是了利用 svnserve.exe 来作为版本库服务器端,配合使用客户端软件TortoiseSVN的简单设置。
使用svnserve.exe作为Subversion服务器的简单设置
作者: 陈海青(josonchen,"船长")
(http://www.chq.name)
(http://www.hhrz.org) (航海日志)
(http://junit.vicp.net)
日期:2008.09.29(yyyy.mm.dd)
关键字: 项目管理, svn,Subversion
本文记录了利用 svnserve.exe 来作为版本库服务器端,配合使用客户端软件TortoiseSVN的简单设置,,主要参照了http://bbs.iusesvn.com/的文章。
1:下载安装(也可到本站hhrz.org 或 chq.name下载中心--Subversion下载:
http://www.chq.name/option,com_remository/Itemid,72/func,select/id_20.html)
http://nchc.dl.sourceforge.net/sourceforge/tortoisesvn/TortoiseSVN-1.4.8.12137-win32-svn-1.4.6.msi
http://subversion.tigris.org/files/documents/15/41687/svn-1.4.6-setup.exe
2:配置svn版本库
1)建立版本库:设定版本库的根目标目录:d:\svn_root\版本库,建立项目子目录 movie,使用客户端软件TortoiseSVN在其中建立仓库结构。
(注意,要在进入子目录里面后,点击右键运行TortoiseSVN来建立仓库结构--2008.10.15)
2)建立工作拷贝:将初始版本拷贝过来。然后在命令行启动svn:
SVNserve -d -r d:\svn_root\版本库
3) 配置权限:编辑d:\svn_roo\t版本库\movie\conf 目录中的三个文件
``代码库基础配置文件 svnserve.conf`` ,如下::(实际上就是去掉几个注释符#)
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz.conf
``用户帐号文件 passwd`` ,如下::(增加几条记录 用户名=口令)
[users]
admin = adminpwd
目录访问权限控制文件authz.conf`` 文件,内容如下::(设置用户组和项目各目录的访问权限)
[groups]
g_admin = admin
[movie:/]
@g_admin = rw
* = r
4)import工作拷贝到版本库(访问地址:svn://localhost/movie),使用客户端软件TortoiseSVN,在工作拷贝目录上操作,使用上述设定的用户名和口令:admin/adminpwd
5)测试:重新下载工作拷贝
6)建立自动运行的服务
下载SVNService(参考附录中的SVNService(将svn作为windows服务运行的工具),chq.name的下载中心也有下载),拷贝到:subversion的安装目录的bin子目录中,如D:\Program Files\Subversion\bin
进入DOS命令行,转到该目录中,运行以下命令,安装服务:
SVNservice -install -d -r d:\svn_root\版本库
安装成功,显示:
SVNService installed.
Commandline set: "-d" "-r" "d:\svn_root\版本库"
查看“服务”,会发现多出一个服务:SVNService,可以根据需要设置成自动/手动,并可以简单测试一番。
至此,安装设置全部完成了。
附录:
1:参考文章:
1):Subversion之路--实现精细的目录访问权限控制(v1.0 更新于2006.12.05):
(http://bbs.iusesvn.com/thread-6-1-1.html)
2):[录像视频]windows安装基于svnserve的subversion服务器演示动画
(http://bbs.iusesvn.com/thread-236-1-1.html)
2:有关资料
1) 本站hhrz.org/chq.name下载中心--Subversion :
http://www.chq.name/option,com_remository/Itemid,72/func,select/id_20.html
2):SVNService(将svn作为windows服务运行的工具)
http://bbs.iusesvn.com/viewthread.php?tid=137&extra=page%3D1%26amp%3Bfilter%3Ddigest
3):Subversion简单常用问题解决方案列表(http://bbs.iusesvn.com/viewthread.php?tid=1981&extra=page%
3D1%26amp%3Bfilter%3Ddigest):
经常有新手配置基于svnserve的subversion服务器后,
在客户端访问subversion版本库时出现这个错误:
svnserve.conf:12: Option expected
为什么会出现这个错误呢,就是因为subversion读取配置文件svnserve.conf时,无法识别有前置空格的
4):eclipse使用subclipse导致jvm崩溃(http://doc.iusesvn.com/show-35-1.html)
http://subclipse.tigris.org/serv ... ers&msgNo=10234
里面说是由于安装svn1.4.4和apache2.2时,一个环境变量所导致的,原文如下:
Subclipse can crash on Windows if you have the environment variable
APR_ICONV_PATH set and it is pointing at a set of libraries that were
built against Apache 2.2. If that is the case, change the environment
variable name to APR_ICONV1_PATH and that will fix the problem. The
libraries from 2.2 will look for the variable with the "1" in it first
anyway. So this is a proper change to make.
If you want to be thorough, you could download the zip file for
Subversion 1.4.3, and point the APR_ICONV_PATH variable at the iconv
folder that came with it.
解决方法:
将环境变量 APR_ICONV_PATH改为APR_ICONV1_PATH
或者下载Subversion 1.4.3的zip包,将环境变量 APR_ICONV_PATH 指向解压后的 iconv文件夹。
--用户变量和系统变量都要修改(20081015补充)。