CentOs 配置SVN服务


1,安装

#yum install subversion

#svnserve --version 查看版本

安装了svn软件后建立svn库

#mkdir /home/svn/repos

#svnadmin create /home/svn/repos

执行上面命令后,会自动在repos下建立conf,db,format,hooks,locks,README.txt文件

2,配置

主要是配置conf文件夹的几个文件,authz,    passwd,    svnserve.conf

其中authz是权限控制,可以设置哪些用户可以访问哪些目录,passwd是设置用户和密码,svnserve是设置SVN相关的操作。

2.1 先设置passwd

[users]
# harry = harryssecret
# sally = sallyssecret
test=test
用户名=密码

2.2 再设置权限authz
authz 授权配置文件 内容格式如下:
其中grooups 里面的帐号 是和 passwd 中对应的(r 只读,w 只写,rw 读写都可)
[groups]
组名 = 帐号1,帐号2
[项目目录:/]
@组名 = rw
@组名 = r
帐号 = rw 

# [/foo/bar]
# harry = rw
# &joe = r
# * =
[repos:/]
test = rw


2.3最后配置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 = 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 directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### 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 the
### directory containing this file.  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 = repos #认证命名空间,<span style="font-family: Arial; font-size: 13px; line-height: 21px; background-color: rgb(238, 238, 238);">认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字。</span>


3,启动svn: svnserve -d -r /home/svn

如果已经有svn在运行,可以换一个端口运行
svnserve  - - / opt / svn / repos  -- listen - port  3391

这样同一台服务器可以运行多个svnserver

好了,启动成功后,就可以使用了。
建议采用TortoiseSVN, 连接地址为: svn: // your server address (如果指定端口需要添加端口  :端口号)

连接后可以上传本地的文件,有效的管理你的代码。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值