﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-sealyu-随笔分类-版本控制</title><link>http://www.blogjava.net/sealyu/category/30671.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 27 Apr 2008 09:08:06 GMT</lastBuildDate><pubDate>Sun, 27 Apr 2008 09:08:06 GMT</pubDate><ttl>60</ttl><item><title>SubVersion(SVN) 安装说明 </title><link>http://www.blogjava.net/sealyu/archive/2008/04/24/195637.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Thu, 24 Apr 2008 08:35:00 GMT</pubDate><guid>http://www.blogjava.net/sealyu/archive/2008/04/24/195637.html</guid><wfw:comment>http://www.blogjava.net/sealyu/comments/195637.html</wfw:comment><comments>http://www.blogjava.net/sealyu/archive/2008/04/24/195637.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/sealyu/comments/commentRss/195637.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/sealyu/services/trackbacks/195637.html</trackback:ping><description><![CDATA[作者：sealyu<br />
1. 简介<br />
SubVersion 是新一代的版本控制工具，不仅可以管理程序源代码，而且也可用于文档或其他相关资料的管理。<br />
2. 下载<br />
svnsetup.exe&nbsp;&nbsp; http://subversion.tigris.org<br />
客户端TortoiseSVN http://tortoisesvn.net/downloads <br />
3. 安装步骤<br />
&nbsp; 1）安装刚才下载的软件<br />
&nbsp; 下面假设svnsetup的安装目录为<br />
&nbsp;C:\Program Files\Subversion<br />
&nbsp;您想建svn库的文件夹为 E:\svn<br />
&nbsp;&nbsp;<br />
&nbsp; 2）创建库<br />
&nbsp; 在E:\svn下，右键-》TortoiseSVN-&gt;Create Repository here.<br />
会在此文件夹下创建一个版本库，生成所需的文件。<br />
&nbsp; 3）创建为Windows自动运行的服务<br />
&nbsp; Subversion 从1.4版本开始，可以以windows系统服务的形式在开机时自动运行。但Subversion安装程序还不能把自己安装成windows服务，需要我们自己进行手动安装，方法如下： 打开一个DOS命令窗口，执行如下命令：　　<br />
sc create svnserve binPath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root E:\svn" displayname= "Subversion Repository" depend= Tcpip start= auto 　　<br />
其中，sc是windows自带的服务配置程序，参数binPath表示svnserve可执行文件的安装路径，由于路径中的"Program Files"带有空格，因此整个路径需要用双引号引起来。而双引号本身是个特殊字符，需要进行转移，因此在路径前后的两个双引号都需要写成\"<br />
-- service参数表示以windows服务的形式运行，--root指明svn repository的位置，service参数与root参数都作为binPath的一部分，因此与svnserve.exe的路径一起被包含在一对双引号当中，而这对双引号不需要进行转义。<br />
displayname表示在windows服务列表中显示的名字， depend =Tcpip 表示svnserve服务的运行需要tcpip服务，start=auto表示开机后自动运行。　　<br />
安装服务后，svnserve要等下次开机时才会自动运行。　　<br />
若要卸载svn服务，则执行 sc delete svnserve 即可。 &nbsp;<br />
4）配置访问权限<br />
&nbsp;1 配置仓库<br />
SVN的svnserve对于每个仓库，有一个独立的配置文件和独立的用户、权限管理。<br />
在这里仍然要保持配置文件svnserve.conf的独立，但是用户、权限管理是用统一的一个文件来存储。<br />
这样方便以后的管理和维护。<br />
另外要注意，即使svnserve服务已经运行，修改配置文件或者用户、权限管理文件，保存后马上生效，不需要重启服务。<br />
假设已经配置两个仓库: source1和source2,都在E:\svn下.<br />
我们在E:\svn下放两个文件:passwd.conf 和authz.conf<br />
1.1 配置source1仓库<br />
进入仓库目录<br />
1.2 修改配置<br />
你可以直接删除默认的svnserve.conf文件，然后使用下面的配置：<br />
编辑svnserve.conf<br />
[general]<br />
anon-access = none <br />
auth-access = write<br />
password-db = ..\..\passwd<br />
authz-db = ..\..\authz<br />
realm = My First Repository<br />
说明：<br />
anon-access = none #不允许匿名用户访问<br />
auth-access = write #通过验证的用户可以读和写<br />
password-db = ..\..\passwd#用户保存文件<br />
authz-db = ..\..\authz#权限管理文件<br />
realm = My First Repository #仓库名称<br />
1.3 配置source2仓库<br />
进入仓库目录<br />
1.4 修改配置<br />
你可以直接删除默认的svnserve.conf文件，然后使用下面的配置：<br />
编辑svnserve.conf<br />
[general]<br />
anon-access = none <br />
auth-access = write<br />
password-db = ..\..\passwd<br />
authz-db = ..\..\authz<br />
realm = My Second Repository<br />
如果有更多的仓库，可以类推配置。<br />
----------------------------------------------------------------------<br />
svnserve.conf的原始内容：<br />
### This file controls the configuration of the svnserve daemon, if you<br />
### use it to allow access to this repository. (If you only allow<br />
### access through http: and/or file: URLs, then this file is<br />
### irrelevant.)<br />
### Visit http://subversion.tigris.org/ for more information.<br />
[general]<br />
### These options control access to the repository for unauthenticated<br />
### and authenticated users. Valid values are "write", "read",<br />
### and "none". The sample settings below are the defaults.<br />
# anon-access = read<br />
# auth-access = write<br />
### The password-db option controls the location of the password<br />
### database file. Unless you specify a path starting with a /,<br />
### the file's location is relative to the conf directory.<br />
### Uncomment the line below to use the default password file.<br />
# password-db = passwd<br />
### The authz-db option controls the location of the authorization<br />
### rules for path-based access control. Unless you specify a path<br />
### starting with a /, the file's location is relative to the conf<br />
### directory. If you don't specify an authz-db, no path-based access<br />
### control is done.<br />
### Uncomment the line below to use the default authorization file.<br />
# authz-db = authz<br />
### This option specifies the authentication realm of the repository.<br />
### If two repositories have the same authentication realm, they should<br />
### have the same password database, and vice versa. The default realm<br />
### is repository's uuid.<br />
# realm = My First Repository<br />
----------------------------------------------------------------------<br />
2 用户管理<br />
2.1 创建用户存储文件<br />
编辑passwd<br />
2.2 设置用户帐号<br />
[users]<br />
harry = harryssecret<br />
sally = sallyssecret<br />
bote = botessecret<br />
说明：<br />
[users] #是必须的，标记为用户配置开始<br />
harry = harryssecret # harry 是用户名 ， harryssecret是密码。注意，是明文密码<br />
sally = sallyssecret # 同上<br />
bote = botessecret # 同上<br />
往后所以仓库的用户都在这里记录就可以了。至于那个用户，允许访问那个仓库，在权限管理里限制。<br />
3 权限管理<br />
3. 1 创建权限管理文件<br />
编辑authz.conf<br />
3.2 设置权限管理<br />
[groups]<br />
source1 = harry<br />
source2 = sally<br />
[source1:/]<br />
@source1 = rw<br />
@source2 = r<br />
<br />
[source2:/]<br />
@source2 = rw<br />
bote = rw<br />
<br />
<img src ="http://www.blogjava.net/sealyu/aggbug/195637.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/sealyu/" target="_blank">seal</a> 2008-04-24 16:35 <a href="http://www.blogjava.net/sealyu/archive/2008/04/24/195637.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>