首先下载最新版本的Subservion for windows,地址:http://sourceforge.net/projects/win32svn/
安装过程很简单,一路next
装完之后,需要创建repository,使用的命令是svnadmin。本例中,我们要在c:/svndemo下建立repository。那么我们使用的命令行如下:
C:/Program Files/Subversion/bin>svnadmin create c:/svndemo
C:/Program Files/Subversion/bin>
建立好repository之后,我们要对Server 进行一些简单的配置。打开c:/svndemo下的conf目录,编辑svnserve.conf,修改里面的内容。
auth-access = write
password-db = passwd
anon-access = read
前面的#去掉,打开这个注释。
同时修改anon-access = none,如果不改的话,就是无需用户名和密码就可以update
现在svnserve.conf的片断看起来类似
[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 = 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 = My First Repository
修改好svnserve.conf后,我们再修改 passwd文件。加入我们需要的用户名ivan和口令123。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
ivan = 123
现在就可以启动server了。启动的方法有很多种,在这里针对本文的环境我们介绍两种,一种是以deamon方式调用,一种是以Windows Service的方式调用。
如果是以deamon的方式调用,那么命令行如下:
现在就可以启动server了。启动的方法有很多种,在这里针对本文的环境我们介绍两种,一种是以deamon方式调用,一种是以Windows Service的方式调用。
如果是以deamon的方式调用,那么命令行如下:
C:/Program Files/Subversion/bin>svnserve -d -r c:/svndemo
如果用Windows Service 的方式来调用server。生成svn服务的命令如下:
C:/>sc create svn binpath= "C:/Program Files/Subversion/bin/svnserve.exe --service -r c:/svndemo" displayname= "Subversion Server" depend= tcpip start= auto
C:/>net start svn