第一课 svn独立服务器(Win32环境)架设
由 admin 于 星期二, 03/22/2011 - 17:30 发表
SVN培训
在线观看 (推荐使用IE6.0以上或360浏览器观看):
第一课视频教程
视频下载(需用迅雷等下载工具下载):
下载地址:http://www.svnclub.com/sites/default/files/svnclub_vedio_1.swf
相关软件:
a:svn服务器软件: Setup-Subversion-1.6.13.msi
b:svn客户端软件: TortoiseSVN-1.6.12.20536-x64-svn-1.6.15.msi
本课教案:
更多svn俱乐部视频教材请访问官网:http://www.svnclub.com
svn独立服务器(Win32)架设步骤
一、准备软件
a:svn服务器软件: Setup-Subversion-1.6.13.msi, 版本1.6.13;
b:svn客户端软件: TortoiseSVN-1.6.12.20536-win32-svn-1.6.15.msi, 版本1.6.12;
c: 运行环境 Microsoft Windows XP Professional SP3。
二、安装软件
先安装客户端软件,再安装服务器端软件。选好路径,按提示安装就可以了。
三、建一个库根目录,创建一个版本库。
命令:
C:\svn\repository>cd \svn\repository
C:\svn\repository>svnadmin create svnregister
下面几步让用户进行认证登陆。
四、修改刚创建的版本库的配置文件:svnregister\conf\svnserve.conf。
## This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.tigris.org/ for more information.
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
# anon-access = read (可设可不设。如果设则把# 去掉,并修改为anon-access = none,前面不能有空格,一行末尾最好也不要留空格)
# auth-access = write (可设可不设。把# 去掉,前面也不能有空格)
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd (必须要设。把# 去掉,前面也不能有空格)
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz (必须要设。把# 去掉,前面也不能有空格)
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
realm = www.svnclub.com (可设可不设。在用户登陆的时候会显示)
[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256
五、修改版本库的用户文件:svnregister\conf\passwd。
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
# harry = harryssecret
# sally = sallyssecret
arain = arain123 (新增用户就这样,前面用户名,后面是密码,一定要顶格)
六、修改版本库的权限控制文件:svnregister\conf\authz。
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
### - a single user,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]( 用户组,方便人多时好配置)
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
# admin = hua001 (前面是组名后面是用户名)
# [/foo/bar]
# harry = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[/]
arain = rw
七、启动svnserve服务。
命令:
C:\svn\repository>svnserve -d -r C:\svn\repository
八、用客户端登陆访问。
在客户端输入:
svn://localhost/svnregister
以上步骤已成功架设好了svn独立服务器。为了方便开机自动启动,我们经常还需要把svnserve这个服务添加到系统服务中去。
九、把svnserve服务加到系统服务中。
命令:
C:\Documents and Settings\Administrator>sc create svn binpath= "svnserve.exe --service -r C:\svn\repository" displayname= "SVN Server" depend= Tcpip start= auto
注意:上面命令的每一个等号后面都有空格,否则会创建失败。
十、其它注意事项。
a. 在服务器端的版本库里是不能直接找到我们提交到svn库的内容。原因:svn以它自己特有的文件系统(FSFS/BDB)保存内容。
b. 客户端(TortoiseSVN)集成到Windows资源管理器中。
c. 客户端如何清除用户信息如帐号等。
d. 安装中文包后如何选择语言。
e. 服务器端的版本库目录名字可以重命名。
f. 查看log信息。
d. 如何删除用户,如何删除版本库
有什么疑问请访问官网:http://www.svnclub.com 留言。