在 Windows 上安装 SVN Subversion 服务端
来源:互联网 发布:老域名出售 编辑:程序博客网 时间:2024/04/28 16:32
现在的Subversion已经足够稳定,而且已经进入了它的黄金时段。我们看到大量的项目都在使用它完成版本控件的工作。本文将主要针对Windows平台讲述安装Subversion服务器的步骤。本文所使用的环境是如下
操作系统
Windows XP Professional SP2
尽量使用原版,因为有朋友反映在部分类似番茄花园的盗版XP上,由于内部文件做过优化,导致Subversion服务端软件异常。
服务端软件
Setup-Subversion-1.6.5.msi
Windows MSI installer with the basic win32 binaries - includes binaries for Apache 2.2.x (2.2.9 or higher is required within the 2.2.x series)
客户端软件
TortoiseSVN-1.6.5.16974-win32-svn-1.6.5.msi
常用的GUI客户端
客户端软件
Slik-Subversion-1.6.5-win32.msi
命令行工具,如果你习惯用cvs的命令行,那这个你会很适应
Subversion的主页是http://subversion.tigris.org/ 或者你也可以直接点击这里下载 Setup-Subversion-1.6.5.msi
TortoiseSVN 的主页是 http://tortoisesvn.tigris.org/ 你也可以直接点击这里下载TortoiseSVN-1.6.5.16974-win32-svn-1.6.5.msi
首先我们安装运行Setup-Subversion-1.6.5.msi安装界面比较简单,我们主要关注安装位置,假定我们安装在默认位置C:/Program Files/Subversion
现在我们创建repository,使用的命令是svnadmin。本例中,我们要在c:/svnroot下建立repository。那么我们使用的命令行如下:
C:/Program Files/Subversion/bin>svnadmin create c:/svnroot
C:/Program Files/Subversion/bin>
建立好repository之后,我们要对Server进行一些简单的配置。打开c:/svnroot下的conf目录,编辑svnserve.conf,修改里面的内容。
auth-access = write
password-db = passwd
anon-access = read
前面的#去掉,打开这个注释。
同时修改anon-access= none
现在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文件。加入我们需要的用户名joe和口令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
joe = 123
现在就可以启动server了。启动的方法有很多种,在这里针对本文的环境我们介绍两种,一种是以deamon方式调用,一种是以Windows Service的方式调用。
如果是以deamon的方式调用,那么命令行如下:
C:/Program Files/Subversion/bin>svnserve -d -r c:/svnroot
服务端开始运行后,我们就可以关注一下客户端的问题了。TortoiseSVN的安装我没有什么可说的,就是一路的NEXT。这里我们描述一下我们的用于test的项目。以本文为例假定我们的项目目录是D:/mytemp/svn_test1,假定目录下有一个test1.txt文件。在svn_test1上按右键选TortoiseSVN-->Import在URL ofrepository里输入svn://192.168.159.129/svnroot 点击OK后,按提示输入用户名和口令,就可以把项目导入Subversion 。好了,现在我们可以试一下,看看刚才我们导入的内容,并开始正常的update,commit工作吧。我们删除svn_test1里面的所有文件。然后在svn_test1目录上按右键选SVN Checkout URL of repository里输入的仍是svn://192.168.159.129/svnrootCheckout directory里输入的是D:/mytemp/svn_test1 Checkout Depth 选择Fullyrecursive,点击OK后,按提示输入用户名和口令,这时我们再看svn_test1目录,就可以看到我们导出的test1.txt文件了。
我们打开test1.txt文件尝试修改并更新一下。我们在test1.txt里加上一行“哈尔滨市,高宏伟QQ:21807822”,然后我们在svn_test1目录上按右键选svncommit,在message中我们可以输入一些日志来标志本次修改,然后点击OK,按提示输入用户名口令就可以提交了。update的操作也是类似,只不过是相反的操作。
界面的操作不太容易用文字来表达,但界面很直观,相信大家摆弄摆弄就可以搞定。刚才为了保证文章的连续性,我们没有说明如何以Windows Service 的方式来调用server。生成svn服务的命令如下:
C:/>sc create svn binpath= "C:/Program Files/Subversion/bin/svnserve.exe --service -r c:/svnroot" displayname= "Subversion Server" depend= tcpip start= auto
C:/>net start svn
这里要特别注意一下sc命令的使用。主要是注意一下=号后面的空格和svn路径的空格。
1. 如果你没有创建服务成功,那你就不要安装到Program Files目录下,因为它带了一个空格,你可以安装到一个比较简单的目录下再试试,如c:/svn_server。
2. 如果安装到这样简单的目录还不能创建成。那你要注意binpath的等号后面有一个空格。你一定要完全按照上面的格式来写。
3. 实在不行你就把所有的环境先都配成和本文一样,然后再直接粘贴过去,这样可以保证你运行成功。等所有的问题都没有了。你再按照你的想像重新安装一次,看看你的问题出在哪儿,这样也好有个对比。
关于Slik-Subversion我在这里就先不做探讨了,它是一个命令行工具。一般来说GUI就可以满足你的简单需要。
- 在 Windows 上安装 SVN Subversion 服务端
- 在 Windows 上安装 SVN Subversion 服务端
- 在 Windows 上安装 SVN Subversion 服务端
- 在 Windows 上安装 SVN Subversion 服务端
- 在 Windows XP上安装 SVN Subversion 服务端
- 在 Windows 上安装 SVN Subversion server
- Windows上安装svn服务端
- Ubuntu15安装Subversion(SVN)服务端
- 在FreeBSD上安装SVN(Subversion)
- windows上安装svn服务端和客户端
- 在Windows上安装Subversion服务器软件
- subversion在windows上的安装
- 在Windows上安装Subversion服务器软件
- windows安装svn服务端
- Windows下SVN服务端(Subversion)及客户端(TortoiseSVN)详细安装教程
- 在Windows上使用Subversion
- 在Windows上使用Subversion
- 在Windows上使用Subversion
- 前端框架的对比(1231最新整理)
- 菜鸟程序员的跨年之夜
- 在 Windows 上安装 SVN Subversion 服务端
- Java类中的serialVersionUID的用途
- 【代码片断】Racket中的写文件
- 在 Windows 上安装 SVN Subversion 服务端
- Windows7 下Eclipse集成Cygwin配置Android NDK环境编译JNI库(1)
- Windows XP设置VPN方法和Windows 7设置VPN方法
- 好男人都死哪儿去了
- 面试总结-13年的最后一天,在面试与被虐中度过
- Mysql常用命令行大全
- WPF Page页调用、触发Window的实现
- 专家提醒:“对乙酰氨基酚”(该品国际非专有药名为Paracetamol,商品名很多)不宜过量使用
- java动态代理实现