图文介绍windows搭建SVN服务端的基本步骤
2012-03-19 10:41
453 查看
转载:http://www.micmiu.com/techother/software/subversion-windows-guide/
具体的安装配置过程如下:
一、首先需要获取服务端和客户端
1.服务端Subversion 截止2010-12-23最新版位1.6.15
官网:http://subversion.tigris.org/ or http://subversion.apache.org/
下载地址:win32svn http://sourceforge.net/projects/win32svn/
2.客户端tortoisesvn 截止2010-12-23最新版位1.6.12
官网:http://tortoisesvn.tigris.org/ or http://tortoisesvn.net
下载地址:http://sourceforge.net/projects/tortoisesvn
二、软件的安装
服务端是以.msi后缀名的安装文件,安装过程就不详细介绍了,按照它的提示一步步操作即可。
我的实际安装路径是D:\Program Files\Subversion
TortoiseSVN 客户端的安装完成后会提示系统需要重启。
三、配置过程
1.创建repository :有两种方法
方法一:命令行创建
打开命令窗口, 键入 svnadmin create D:\svnroot\test1 回车,
会在 目录 D:\svnroot\生成test1文件夹以及文件夹下相应的文件
方法二:图形化创建
新建文件夹 D:\svnroot\test2(文件夹下必须是空的),在该文件夹下右击选中TortoiseSVN,如下图
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/c102b5302b5ea2a7d5640b34b65c8896.jpg)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/4f0edc89ba957a66ab0cfffef20bedd5.jpg)
上面两种方法都能创建repository ,创建好后生成的目录结构如下:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/42a4bc5510502d0342da3cd9601b31a4.jpg)
2.修改配置文件(以上面创建的test1为例:)
在D:\svnroot\test1\conf\ 目录下会看到 svnserver.conf和passwd两个文件,需要对两个文件作如下修改:
svnserve.conf
Java代码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201304/3fde6ead3502a76fb29a9dc09d5fa70d.png)
[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
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
这段配置文件的基本含义为:
anon-access = read 匿名用户的权限,文件中为read表示拥有只读权限
auth-access = write 验证通过用户的权限 ,文件中为write表示拥有写的权限
权限包括none、read、write三个值可选,none没有权限,写包含了读权限
去掉#注释时,前面不要有空格
password-db = passwd密码数据存放到passwd文件中
authz-db = authz 表示版本库中访问路径的规则,即谁只能访问哪个目录下的文件,其他目录下的文件无法访问
passwd
Java代码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201304/3fde6ead3502a76fb29a9dc09d5fa70d.png)
### 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
michael=michael
PS:passwd 文件中的配置,如:michael=michael表示用户名为michael,密码为michael
四、启动subversion服务
两种方法:命令启动和服务启动
1.命令行启动介绍:
svnserve -d -r D:\svnroot\test1
默认端口是3690,如果这个端口号已经被占用,则可以通过选项 --listen-port=端口号.
2.服务启动介绍:
安装程序还不能把自己安装成windows服务,需要自己进行手动安装,方法如下: 打开命令窗口,执行如下命令:
Java代码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201304/3fde6ead3502a76fb29a9dc09d5fa70d.png)
sc create svnserve binPath= "\"d:\Program Files\Subversion\bin\svnserve.exe\" --service -r d:\svnroot\test1" displayname= "Subversion" depend= Tcpip start= auto
执行成功会显示:[SC] CreateService 成功
打开命令窗口键入:services.msc 回车,会在windows的服务中看到刚创建的:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/80a58dc9f5293b2c7149fdec5268ada4.jpg)
命令的简单解释:
sc是windows自带的服务配置程序,
参数binPath表示svnserve可执行文件的安装路径,由于路径中的"Program Files"带有空格,因此整个路径需要用双引号引起来。而双引号本身是个特殊字符,需要进行转移,因此在路径前后的两个双引号都需要写成\"
--service参数表示以windows服务的形式运行,
-r/--root指明svn repository的位置,service参数与root参数都作为binPath的一部分,因此与svnserve.exe的路径一起被包含在一对双引号当中,而这对双引号不需要进行转义。
displayname表示在windows服务列表中显示的名字
depend =Tcpip 表示svnserve服务的运行需要tcpip服务
start=auto表示开机后自动运行
若要卸载svn服务,则执行 sc delete svnserve 即可
安装服务后,svnserve要等下次开机时才会自动运行。
五、导入项目
图形化操作即可实现具体步骤如下:
选中需要导入的项目:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/e98a59ec66c6a92d2a79f4b1e5a57c73.jpg)
输入URL和message
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/f12d14d586d82c858c6cf051bad5d581.jpg)
输入用户名和密码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201403/a84f61e36fcda33e7f5e68077aab7767.jpg)
成功导入文件
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/31fa021ef7928df0a20c48cb15a5f3f0.jpg)
到此基本完成了svn服务端的安装、配置、启、导入项目等一系列操作。
具体的安装配置过程如下:
一、首先需要获取服务端和客户端
1.服务端Subversion 截止2010-12-23最新版位1.6.15
官网:http://subversion.tigris.org/ or http://subversion.apache.org/
下载地址:win32svn http://sourceforge.net/projects/win32svn/
2.客户端tortoisesvn 截止2010-12-23最新版位1.6.12
官网:http://tortoisesvn.tigris.org/ or http://tortoisesvn.net
下载地址:http://sourceforge.net/projects/tortoisesvn
二、软件的安装
服务端是以.msi后缀名的安装文件,安装过程就不详细介绍了,按照它的提示一步步操作即可。
我的实际安装路径是D:\Program Files\Subversion
TortoiseSVN 客户端的安装完成后会提示系统需要重启。
三、配置过程
1.创建repository :有两种方法
方法一:命令行创建
打开命令窗口, 键入 svnadmin create D:\svnroot\test1 回车,
会在 目录 D:\svnroot\生成test1文件夹以及文件夹下相应的文件
方法二:图形化创建
新建文件夹 D:\svnroot\test2(文件夹下必须是空的),在该文件夹下右击选中TortoiseSVN,如下图
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/c102b5302b5ea2a7d5640b34b65c8896.jpg)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/4f0edc89ba957a66ab0cfffef20bedd5.jpg)
上面两种方法都能创建repository ,创建好后生成的目录结构如下:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/42a4bc5510502d0342da3cd9601b31a4.jpg)
2.修改配置文件(以上面创建的test1为例:)
在D:\svnroot\test1\conf\ 目录下会看到 svnserver.conf和passwd两个文件,需要对两个文件作如下修改:
svnserve.conf
Java代码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201304/3fde6ead3502a76fb29a9dc09d5fa70d.png)
[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
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
这段配置文件的基本含义为:
anon-access = read 匿名用户的权限,文件中为read表示拥有只读权限
auth-access = write 验证通过用户的权限 ,文件中为write表示拥有写的权限
权限包括none、read、write三个值可选,none没有权限,写包含了读权限
去掉#注释时,前面不要有空格
password-db = passwd密码数据存放到passwd文件中
authz-db = authz 表示版本库中访问路径的规则,即谁只能访问哪个目录下的文件,其他目录下的文件无法访问
passwd
Java代码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201304/3fde6ead3502a76fb29a9dc09d5fa70d.png)
### 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
michael=michael
PS:passwd 文件中的配置,如:michael=michael表示用户名为michael,密码为michael
四、启动subversion服务
两种方法:命令启动和服务启动
1.命令行启动介绍:
svnserve -d -r D:\svnroot\test1
默认端口是3690,如果这个端口号已经被占用,则可以通过选项 --listen-port=端口号.
2.服务启动介绍:
安装程序还不能把自己安装成windows服务,需要自己进行手动安装,方法如下: 打开命令窗口,执行如下命令:
Java代码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201304/3fde6ead3502a76fb29a9dc09d5fa70d.png)
sc create svnserve binPath= "\"d:\Program Files\Subversion\bin\svnserve.exe\" --service -r d:\svnroot\test1" displayname= "Subversion" depend= Tcpip start= auto
执行成功会显示:[SC] CreateService 成功
打开命令窗口键入:services.msc 回车,会在windows的服务中看到刚创建的:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/80a58dc9f5293b2c7149fdec5268ada4.jpg)
命令的简单解释:
sc是windows自带的服务配置程序,
参数binPath表示svnserve可执行文件的安装路径,由于路径中的"Program Files"带有空格,因此整个路径需要用双引号引起来。而双引号本身是个特殊字符,需要进行转移,因此在路径前后的两个双引号都需要写成\"
--service参数表示以windows服务的形式运行,
-r/--root指明svn repository的位置,service参数与root参数都作为binPath的一部分,因此与svnserve.exe的路径一起被包含在一对双引号当中,而这对双引号不需要进行转义。
displayname表示在windows服务列表中显示的名字
depend =Tcpip 表示svnserve服务的运行需要tcpip服务
start=auto表示开机后自动运行
若要卸载svn服务,则执行 sc delete svnserve 即可
安装服务后,svnserve要等下次开机时才会自动运行。
五、导入项目
图形化操作即可实现具体步骤如下:
选中需要导入的项目:
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/e98a59ec66c6a92d2a79f4b1e5a57c73.jpg)
输入URL和message
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/f12d14d586d82c858c6cf051bad5d581.jpg)
输入用户名和密码
![](https://oscdn.geek-share.com/Uploads/Images/Content/201403/a84f61e36fcda33e7f5e68077aab7767.jpg)
成功导入文件
![](https://oscdn.geek-share.com/Uploads/Images/Content/201910/30/31fa021ef7928df0a20c48cb15a5f3f0.jpg)
到此基本完成了svn服务端的安装、配置、启、导入项目等一系列操作。
相关文章推荐
- 图文介绍windows搭建SVN服务端的基本步骤
- 图文介绍windows搭建SVN服务端的基本步骤
- 图文介绍windows搭建SVN服务端的基本步骤
- Windows下SVN服务器搭建和基本操作(服务端、客户端)
- Windows下SVN服务器搭建与使用图文教程(一)
- 图文介绍windows下实现编译ffmpeg工程的详细步骤
- Windows下SVN服务器搭建与使用图文教程(二)
- windows下详细图文教你搭建<进击的9秒>服务端【Firefly】
- 图文介绍Android环境搭建详细步骤
- Windows下cwRsync搭建步骤(文件同步教程图文详解)
- 团队开发利器,图文详解windows下创建svn服务器,visualSVN服务端;tortoisesvn;传了30多遍还不知道这次可能传上去
- Windows下SVN服务器搭建与使用图文教程(三)
- SVN版本控制搭建基本步骤
- svn服务端及客户端搭建(WINDOWS)
- WINDOWS下搭建SVN服务器端的步骤分享(Subversion)
- windows下搭建本机SVN服务端和客户端
- windows下svn服务器快速搭建图文教程
- CentOS搭建SvnAdmin服务端详细步骤
- Windows下搭建SVN服务器简明步骤
- 图文介绍Android环境搭建详细步骤