Apache HTTP Server + SVN 版本控制方案(一)

SVN的用处就不多说。直奔主题——如何配置SVN服务器?

 

首先第一篇讲述简单的SVNServer协议的配置,第二篇才会涉及到Apache HTTP Server 与 SVN 服务器的配置。其实网上这方面的例子很多了,不过这个例子绝对简单易用,一学就会

 

第一步:所需的软件,我会在附件中打包提供给各位下载

 

svn-1.4.6-setup.exe SVN 服务器

 

TortoiseSVN-1.4.6.11647-win32-svn-1.4.6.msi  SVN 客户端

 

LanguagePack-1.4.6.11647-win32-zh_CN.exe   SVN 客户端汉化包

 

上述这些也软件也可以到这个网站下载:http://bbs.iusesvn.com/thread-2230-1-1.html

 

第二步:安装, 步骤省略,太简单了

 

    1、安装SVN服务器。

    2、安装SVN客服端, 安装好之后(可能需要重启机器)鼠标右键会出现TortoiseSVN的菜单。(太大没法上传)

    3、安装SVN 客户端汉化包,英文好的可以不装,建议不要安装。

 

第三步:使用SVN客户端工具创建一个版本库(其实使用命令行模式也可以,但使用图形化的工具更直观)

     

     1、在硬盘上创建如下文件目录,名为:e:\svnroot\repos01

     2、鼠标选中repos01目录,右键选择TortoiseSVN——>Create repository here即可。在repos01目中就与版本库相关的目录出现了。

     

第四步:修改e:\svnroot\repos01\conf下的文件:

 

1、修改svnserve.conf文件, 修改后的内容如下

 

### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[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 conf directory.
### 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 conf
### directory.  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

  

 

2、修改authz, 修改后的内容如下

 

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to a
### single user, to a group of users defined in a special [groups]
### section, or to anyone using the '*' wildcard.  Each definition can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[groups]
# harry_and_sally = harry,sally

# [/foo/bar]
# harry = rw
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r

[/]
brofe=rw

 

 

3、修改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
brofe=brofe

 

 

 

第四步:将SVNServer做成WinXP系统服务,并随操作系统一起启动

 

    1、新建一个startsvn.bat文件,然后进行如下内容的编辑操作(注意不要复制, 最好自己手动的抄写一遍,以免其中的空格引起错误)

          

                sc create svnserve binpath= "D:\Program Files\Subversion\bin\svnserve.exe --service --root e:\svnroot"

                displayname= "Subversion" depend= tcpip start= auto

 

                // 参数的相关解释

                (1)  D:\Program Files\Subversion\bin\svnserve.exe   指的是:SVN服务安装目录

                (2)  e:\svnroot  e:\svnroot\repos01该目录的一部分。

                (3)  displayname= "Subversion"   当执行该bat文件后, 如果在操作系统的服务中看到了名为: Subversion的服务就表示安装正常

 

     2、执行bat文件(可能需要重新启动),查看系统服务中是否存在名为:Subversion的服务,若存在表示SVN服务器配置成功。

 

第五步:测试服务器是否正常工作

 

     1、在系统的任何地方鼠标右键,选择:TortoiseSVN——>Repo-browser, 然后输入如下地址:svn://localhost/repos01

 

     2、当没有出现Error.....  信息之后,就表示安装成功。你可以使用TortoiseSVN客户端和Eclipse SVN 客户端插件进行相应的操作。

 

 

备注:

    1、如果严格按上述步骤做一定会成功。如果硬是有怪问题,可能是软件版本有问题。

 

    2、该帖中没涉及版本库配置的高级特性,特别是安全性方面没有详细介绍,想学的朋友可以在网上搜索,资料一大堆,好用的,直观的不多。不过有时间我会整理放上来的。

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值