windows下架设SVN服务器并设置开机启动

简介: 原文:windows下架设SVN服务器并设置开机启动1、安装SVN服务器,到http://subversion.apache.org/packages.html上下载windows版的SVN,并安装,在命令行下运行svn命令,如下所以,则svn服务器安装成功。
原文: windows下架设SVN服务器并设置开机启动

1、安装SVN服务器,到http://subversion.apache.org/packages.html上下载windows版的SVN,并安装,在命令行下运行svn命令,如下所以,则svn服务器安装成功。

  1. C:\Documents and Settings\Administrator>svn   
  2. 使用“svn help”得到用法。  

           

2、创建仓库Repository:运行命令

  1. C:\Documents and Settings\Administrator>svnadmin create G:\svn  

 

  该命令会在G盘下自动创建一个名字为svn的文件夹,该文件中的内容如非必要,不要手动修改,其内容是由svn自动维护的,各自得用途: 

  conf里文件夹中都是这个仓库的配置文件。 

  db是真正用来存储数据版本的地方。 

  hooks文件夹中的内容用以定义某些动作触发的hook脚本。 

  locks中的文件用于在某些分支或者文件上加锁。    

3、创建用户:进入conf目录(本例中是G:\svn\conf),打开svnserve.conf文件,找到如下内容:

  1. [general]   
  2. ### These options control access to the repository for unauthenticated   
  3. ### and authenticated users.  Valid values are "write""read",   
  4. ### and "none".  The sample settings below are the defaults.   
  5. # anon-access = read   
  6. # auth-access = write   
  7. ### The password-db option controls the location of the password   
  8. ### database file.  Unless you specify a path starting with a /,   
  9. ### the file's location is relative to the directory containing   
  10. ### this configuration file.   
  11. ### If SASL is enabled (see below), this file will NOT be used.   
  12. ### Uncomment the line below to use the default password file.   
  13. # password-db = passwd  

   将

  1. # anon-access = read   
  2. # auth-access = write   
  1. # password-db = passwd  

  中的注释去掉修改为

 

  1. anon-access = read   
  2. auth-access = write   
  1. password-db = passwd  

 

 这样就可以使用passwd文件中的用户了。

  打开passwd(和svnserve.conf在同目录下),可以看到,创建好的两个用户都被注释掉了,可以修改者两个用户,也可以新建自己的用户,这里我新创建了一个自己的用户,passwd文件被修改为:

  1. [users]  
  2. # harry = harryssecret  
  3. # sally = sallyssecret  
  4. admin=admin  

4、启动SVN服务器,运行命令svnserve -d -r G:\svn,就可以启动服务

  1. C:\Documents and Settings\Administrator>svnserve -d -r G:\svn  

   -d表示后台运行,-r表示以超级管理员的方式运行,G:\svn是指SVN所管理的仓库。

5、配置SVN服务器开机启动

  打开一个DOS窗口,在任意目录下执行下面的命令:

 

  1. //在命令中的每一个等号后面都要有一个空格否则命令执行失败  
  2. sc create svnserve binPath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root d:\svnstore" displayname= "SVN Serve" depend= Tcpip start= auto  

    

  其中,sc是windows自带的服务配置程序,参数binPath表示svnserve可执行文件的安装路径,由于路径中的"Program Files"带有空格,因此整个路径需要用双引号引起来。而双引号本身是个特殊字符,需要进行转移,因此在路径前后的两个双引号都需要写成\"

  --service参数表示以windows服务的形式运行,--root指明svn repository的位置,service参数与root参数都作为binPath的一部分,因此与svnserve.exe的路径一起被包含在一对双引号当中,而这对双引号不需要进行转义。

displayname表示在windows服务列表中显示的名字, depend =Tcpip 表示svnserve服务的运行需要tcpip服务,start=auto表示开机后自动运行。

  安装服务后,svnserve要等下次开机时才会自动运行。

  若要卸载svn服务,则执行 sc delete svnserve 即可

这样SVN的配置就完成了,到http://tortoisesvn.net/downloads.html下载一个SVN客户端,就可以使用了。

目录
相关文章
|
2月前
|
Shell Windows
Windows服务器 开机自启动服务
Windows服务器 开机自启动服务
19 0
|
22天前
|
安全 Unix Linux
Windows如何远程连接服务器?服务器远程连接图文教程
服务器操作系统可以实现对计算机硬件与软件的直接控制和管理协调,任何计算机的运行离不开操作系统,服务器也一样,服务器操作系统主要分为四大流派:Windows Server、Netware、Unix和Linux。今天驰网飞飞将和你分享Windows server远程连接图文教程,希望可以帮助到你
33 4
Windows如何远程连接服务器?服务器远程连接图文教程
|
4天前
|
存储 Linux 网络安全
都2023年了还不了解?使用FileZilla搭建信息文件服务器(Windows7)
都2023年了还不了解?使用FileZilla搭建信息文件服务器(Windows7)
|
4天前
|
安全 网络协议 网络安全
在Windows7搭建FTP服务器详细教学
在Windows7搭建FTP服务器详细教学
|
5天前
|
安全 Linux 网络安全
Windows搭建Emby媒体库服务器,无公网IP远程访问本地影音文件
Windows搭建Emby媒体库服务器,无公网IP远程访问本地影音文件
16 0
|
5天前
|
Apache 项目管理 数据安全/隐私保护
Windows如何安装使用TortoiseSVN客户端并实现公网访问本地SVN Server
Windows如何安装使用TortoiseSVN客户端并实现公网访问本地SVN Server
13 0
|
5天前
|
安全 Linux 数据库
windows服务器 cwRsyncServer 搭建步骤
windows服务器 cwRsyncServer 搭建步骤
17 0
windows服务器 cwRsyncServer 搭建步骤
|
11天前
|
Apache 项目管理 数据安全/隐私保护
Windows安装TortoiseSVN客户端结合Cpolar实现公网提交文件到本地服务器
Windows安装TortoiseSVN客户端结合Cpolar实现公网提交文件到本地服务器
|
13天前
|
网络协议 Windows
Windows Server 各版本搭建 DNS 服务器实现域名正反向解析
Windows Server 各版本搭建 DNS 服务器实现域名正反向解析
|
21天前
|
搜索推荐 Windows
Windows11轻松设置v1.09
Win11轻松设置软件是一款免费无广告专门为Windows 11系统设计的工具软件,即开即用,具有多种特色功能和亮点。通过界面简洁、个性化定制、一键优化等功能,可以更加便捷地进行系统设置和管理。由于整合了实用的常用功能,故无需使用多种小工具即可完成绝大部分的优化调整。
48 0
Windows11轻松设置v1.09