提问的智慧SVN版 - 提问者必读
返回列表 回复 发帖

[TechNote] SVNService(将svn作为windows服务运行的工具)

(注意:svn1.4.0以上可以不用这个工具也可以以服务的方式启动,参考http://bbs.iusesvn.com/viewthread.php?tid=358)
SVN Service Wrapper for Windows
This is my Win32 Service wrapper for SVN. Source is included, and its in the public domain. No need to copyright this stuff.

Usage instructions:

  SVNService -?                               to display this list
  SVNService -install <svnserve parameters>   to install the service
  SVNService -setup <svnserve parameters>     to change command line parameters for svnserve
  SVNService -remove                          to remove the service
  SVNService -debug                           to run as a console app for debugging

将svnservice.exe放在subversion的bin目录下

Example:
比如,你的所有项目都在c:\svnrepo下,你可以如下
安装时用  SVNService -install -d -r c:\svnrepo
更改时用  SVNService -setup -d -r c:\otherplace\svnrepo
如果访问其中的一个项目c:\svnrepo\project1,可以指定路径

svn://localhost/project1 (注:作为url时用/)

第一次安装完后要到服务中手动启动它,
或者到服务中将它设为自动启动,让每次机器启动时自动启动这个服务。

IMPORTANT:

  Make sure you place SVNService.exe in the same directory as svnserve.exe
  一定要将SVNService.exe放在svnserve.exe相同的目录
Special thanks go to Craig Link at Microsoft for creating the initial service.c.

-Magnus Norddahl
(备注:以上中文由PCplayer添加)

SVNService.rar (23.82 KB)

回复 #1 PCplayer 的帖子

想知道官方下载地址 ?!!
官方地址在TSVN1.3.5的帮助中有,我现在是1.4,里面没有,我在其它地方再找找贴出来。

官方的包里面东西比较多比较杂,我发的这个是精简的

回复 #3 PCplayer 的帖子

恩,是挺杂的
找不到
帮助里的几个连接 有的要权限
没辙!

帮助里的信息:
3.2. Svnserve Based Server
3.2.1. Introduction
There may be situations where it's not possible to use Apache as your server. Fortunately, Subversion includes Svnserve - a lightweight stand-alone server which uses a custom protocol over an ordinary TCP/IP connection.

In most cases svnserve is easier to setup and runs faster than the Apache based server.

3.2.2. Installing svnserve

Get the latest version of Subversion from http://subversion.tigris.org/ser ... entList?folderID=91 .

Run the Subversion installer. If you run the installer on your server you can skip step 3.

Open the windows-explorer, go to the installation directory of Subversion (usually C:\Program Files\Subversion) and in the bin directory, find the files svnserve.exe, libdb43.dll, libeay32.dll and ssleay32.dll - copy these files into a directory on your server e.g. c:\svnserve


3.2.3. Running svnserve
Now that svnserve is installed, you need it running on your server. The simplest approach is to run the following from a DOS shell or create a windows shortcut:

svnserve.exe -d

svnserve will now start waiting for incoming requests on port 3690. The -d switch tells svnserve to run as a daemon process, so it will always exist until it is manually terminated.

If you have not yet created a repository, follow the instructions given with the Apache server setup Section 3.1.4, “Configuration”.

To test that svnserve is working, use TortoiseSVN → Repo-Browser to view a repository.

Assuming your repository is located in c:\repos\TestRepo, and your server is called localhost, enter:

svn://localhost/repos/TestRepo

when prompted by the repo browser.

You can also increase security and save time entering Url's with svnserve by using the -r switch to set the root location and restrict access to a specified directory on the server:

svnserve.exe -d -r drive:\path\to\repository

Using the previous test as a guide, svnserve would now run as:

svnserve.exe -d -r c:\repos

And in TortoiseSVN our repo-browser Url is now shortened to:

svn://localhost/TestRepo

Note that the -r switch is also needed if your repository is located on a different partition or drive than the location of svnserve on your server.

Warning
Do not create or access a Berkeley DB repository on a network share. It cannot exist on a remote filesystem. Not even if you have the network drive mapped to a drive letter. If you attempt to use Berkeley DB on a network share, the results are unpredictable - you may see mysterious errors right away, or it may be months before you discover that your repository database is subtly corrupted.

Run svnserve as a Service
If you are concerned about always having a user logged in on your server, or worried about someone shutting down svnserve or forgetting to restart it after a reboot, it is possible to run svnserve as a windows service using a wrapper like the one available at svnservice provided by Magnus Norddahl. Note that SVNService installs svnserve as a manual service, you may want to change this to automatic.

More generic tools like firedaemon will also work. Note that you will still need to run svnserve with the -d switch.


3.2.4. Authentication with svnserve
The default svnserve setup provides anonymous read-only access. This means that you can use an svn:// Url to checkout and update, or use the repo-browser in TortoiseSVN to view the repository, but you won't be able to commit any changes.

To enable write access to a repository, you need to edit the conf/svnserve.conf file in your repository directory. This file controls the configuration of the svnserve daemon, and also contains useful documentation.

You can enable anonymous write access by simply setting:

回复 #4 jessiee 的帖子

http://dark.clansoft.dk/~mbn/svnservice/ 下载SVNService.zip并把它解压到{Subversion}\bin目录下,通过运行 svnservice -install -d -r D:\repository\project1 ,执行的结果显示:SVNService installed. 这时候你可以在服务控制台中看到名为SVNService的服务,启动它就可以了,如果你不想用服务的方式启动Subversion,你可以运行svnserve -d来启动Subversion。

要卸载SVNService服务,只需要运行 SVNService -remove 即可。
不错,你自己找到了

回复 #6 PCplayer 的帖子

恩  是找到了 ,网上也都是这么写的  


http://dark.clansoft.dk/~mbn/svnservice/

可这个网上不去!还没有注册!
郁郁了!
你为什么要原来的包呢?

回复 #8 PCplayer 的帖子

论坛里的也应该是 官方上下的吧  
头儿想看看!
还有就是 升级的问题,SVNSERVICE.EXES涉及升级吗?

论坛里的就是官方上下的然后精简一下。
svnservice.exe跟升级关系不大
请教我下不了这个压缩包是不是我的设置有问题啊

回复 #11 lapeqq 的帖子

网站没有问题,看看你的浏览器设置

now what

原始版本http://dark.clansoft.dk/~mbn/svnservice明显早已失效了。。。
还好有这个版本。
请问此第三方程序和svn自己的svnserve.exe有什么区别?

另外请PCPlayer纠错一下,
如果安装时用  SVNService -install -d -r c:\svnrepo
访问其中的一个项目c:\svnrepo\project1时,应该指定路径
svn://localhost/project1,
而不是svn://localhost/svnrepo/project1

最后,SVNService.exe的-d解释为debug,而svnserve.exe的-d解释为deamon,感觉后者更便于理解。
1

评分次数

  • PCplayer

回复 #13 jaxx.chen 的帖子

非常感谢

ye

哈,3x
刚才犯了个错误,
查到不少:“当你不想使用 Apache 2.x 时候,你也可以使用 Subversion,它可以以守护进程或者是Windows 下的服务方式独立运行;”
可见,svn自带的svnserve.exe可以采用守护进程模式,所以-d即deamon
而dark.clansoft的svnservice.exe是系统服务模式,-d为debug.
已经发现460+人下载了,感谢训导主任分享!


P.S. 自带svnserve.exe的帮助命令猜也能猜到是"-h",不要被它
《请使用“svnserve help”以得到用法和帮助。》
给骗了..orz...

[ 本帖最后由 jaxx.chen 于 2006-10-20 17:52 编辑 ]

ding yi xia

ding yi xia ,na fen

ding yi xia

ding yi xiading yi xiading yi xiading yi xia
我上BAIDU搜了好久了,终于找到了
刚好想要这个,不过还不会用呢

 俺咋下载不了呢? IE浏览器。
返回列表
订阅 我用Subversion - SVN中文论坛 邮件列表:iUseSVN@googlegroups.com
电子邮件:
网站重要事项将会在这个列表进行通知,点击这里浏览存于列表中的所有邮件