随笔-179  评论-666  文章-29  trackbacks-0

一、安装
下载
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91

如:安装到 D:\deploy\Subversion

二、建立Repository

打开命令窗口, 键入 :
    svnadmin create --fs-type fsfs G:\svnsrc\game

三、配置Repository

进入Repository目录,在本文中是 G:\svnsrc\game
,你会看到conf目录,进入该目录,你会看到svnserve.conf和passwd两个文件

对两个文件作如下修改

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 
= 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 conf directory.
### Uncomment the line below to use the default password file.
password-db 
= passwd

passwd

[users]
# harry 
= harryssecret
# sally 
= sallyssecret
alpha
=123456


svnserve.conf中的[general] 和 passwd 中的 [users]  行前有#,一定要去掉,不要有空格


四、启动subversion

打开命令窗口键入
     svnserve -d -r G:\svnsrc

默认端口是3690,如果不幸这个端口被别的程序暂用,可以通过选项 --listen-port=绑定端口

url格式为  svn://ip地址//Repository 名,在本文中是svn://127.0.0.1/game



======

将Subversion安装成service。让subversion在windows自动启动

以前的svnserve要想成为windows服务,必须依赖于svnservice或其他工具。从Subversion1.4开始,Subversion本身就集成Windows服务的工具。


1,安装svnservice
在Windows NT中(包括Windows XP, Windows 2000, Windows 2003 Server)本身包含了一个安装服务的工具,叫做"Service Control",也就是sc.exe。

例如我的Subversion安装在"D:Subversion",版本库在"D:svnroot",而我希望对应的Subversion服务名为svnservice,安装这个svn服务的命令就可以这样写:

      sc create svnservice
      binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
      displayname= "SVNService"
      depend= Tcpip
     
请注意,因为便于察看,上面的命令分为多行,但在实际执行时应该在一行里。另外,在以前启动svnserve时会使用"-d"选项,也就是守护进程模式,在这里不能使用,会导致服务无法启动。同样,"-i"和"-t"选项也不能使用。

在命令行窗口执行完这个命令之后,服务还没有启动,你可以继续运行"net start svnservice"启动这个服务,然后使用"net stop svnservice"停止服务。

另外还有两点需要小心处理。首先,如果路径中包括空格,一定要用“”处理“"”号,例如上面的例子中如果svnserve.exe在“c:program filessubversion”中,则命令应该写为“binpath= ""c:program filessubversionbinsvnserve.exe"”(“”中的内容),整个命令如下,红色部分是改变部分:

      sc create svnservice
      binpath= ""D:program filesSubversionbinsvnserve.exe" --service -r D:svnroot"
      displayname= "SVNService"
      depend= Tcpip
     
其次,sc对选项的格式还有要求,例如“depend= Tcpip”不能写为“depend = Tcpip”或“depend=Tcpip”,也就是“=”前不能有空各,而后面必须有空格。


2,删除服务
如果服务安装的有问题,你可能需要删除服务。要删除前面添加的服务,只需要运行"sc delete svnservice","svnservice"就是我们创建服务时使用的名字。


3,配置服务是自动启动
默认情况下安装的服务不会随Windows的启动而启动,为了使svn服务能够随Windows启动而启动,需要修改一下"sc create"命令(首先要删除),增加"start= auto"选项:

      sc create svnservice
      binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
      displayname= "SVNService"
      depend= Tcpip
      start= auto
     
当然你也可以使用图形化的工具修改服务的属性,你可以在“开始->运行...”中执行"services.msc",然后在界面中修改。



 

posted on 2007-08-29 22:13 Alpha 阅读(11147) 评论(4)  编辑  收藏 所属分类: Java J2EE JSP开源开发工具使用

评论:
# re: windows下架设subversion服务器 2007-08-31 03:04 | peel
too complicated! too professional!

kan bu dong!:)  回复  更多评论
  
# re: windows下架设subversion服务器[未登录] 2007-09-12 08:41 | 流水
死AA,好好的一个博客就给你老人家这么糟蹋了
  回复  更多评论
  
# re: windows下架设subversion服务器 2008-04-05 17:51 | 鱼不爱水
兄弟谢谢了 很专业很完美  回复  更多评论
  
# re: windows下架设subversion服务器 2008-05-11 03:47 | 老蔡
非常好,如果是原创,作者很有专业素质,希望以后多看到这样的文章.谢谢  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: