svn安装与配置

 

安装Subversion

 

1 安装svn setup。

2 将SVN配置成服务。一般情况下,我们将SVN服务安装成可以以windows系统服务的形式在开机时自动运行。但Subversion安装程序还不能把自己安装成windows服务,需要我们自己进行手动安装,方法如下:打开一个DOS命令窗口,执行如下命令:
sc create svnserve binPath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root d:\svn" DisplayName= "Subversion" depend= Tcpip start= auto

注意在binPath 、 DisplayName、depend、start后的=号要紧跟其后。

其 中,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要等下次开机时才会自动运行。若要马上运行服务,则执行net start Subversion 即可。

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

 

3 配置用户权限。
使匿名用户无访问权限。只允许认证用户访问。
打开d:\svn\conf\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

添加用户szy,密码:szy
打开D:\svn\conf\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]
szy = szy

建立一个用户组admin,并把我自己加入这个组,赋予这个组中成员读写的权利。^_^,只有我能这个SVN版本库进行操作喽。
打开D:\svn\conf\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]
admin = szy

[/]
* = r
@admin = rw

重启Subversion服务后生效。

 

subversion是可以很好地控制中文目录的权限的。

方法很简单,就是将你的权限控制文件的格式转换为UTF-8格式,
将权限文件改成UTF-8格式我使用的是UltraEdit的菜单"ASCII to UTF-8 (Unicode Editing)"。

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值