CentOS 7搭建SVN服务器

SVN服务器搭建教程
本文详细介绍了如何在Linux环境下搭建Subversion (SVN) 服务器的过程。从安装Subversion到创建版本库,再到配置权限及启动服务等步骤均有涉及。此外,还提供了Windows客户端连接测试的方法。

安装步骤如下:

1、yum install subversion

2、查看安装版本 svnserve --version

   103645_JECD_868835.png

3、创建SVN版本库目录 mkdir -p /var/svn/svnrepos

4、创建版本库  svnadmin create /var/svn/svnrepos

   执行了这个命令之后会在/var/svn/svnrepos目录下生成如下这些文件

   103726_hxk3_868835.png

5、进入conf目录(该svn版本库配置文件)cd conf/
   authz文件是权限控制文件
   passwd是帐号密码文件
   svnserve.conf SVN服务配置文件

6、设置帐号密码 vi passwd
   在[users]块中添加用户和密码,格式:帐号=密码,如janus=123456

   103822_8yOY_868835.png

7、设置权限 vi authz
   在末尾添加如下代码:

  1. [/]  
  2. janus = rw

### 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,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe


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

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


[/]
janus = rw

   

   意思是版本库的根目录quwenzhe对其有读写权限

8、修改svnserve.conf文件  vi svnserve.conf
   打开下面的几个注释:
   anon-access = read #匿名用户可读
   auth-access = write #授权用户可写
   password-db = passwd #使用哪个文件作为账号文件
   authz-db = authz #使用哪个文件作为权限文件
   realm = /var/svn/svnrepos # 认证空间名,版本库所在目录

   104141_ffTI_868835.png

9、启动svn版本库  svnserve -d -r /var/svn/svnrepos

    停止可以使用以下命令

[root@localhost conf]# ps aux |grep svn
root       7637  0.0  0.0 164236   904 ?        Ss   10:34   0:00 svnserve -d -r /var/svn/svnrepos
root       7674  0.0  0.0 114712   976 pts/2    R+   10:42   0:00 grep --color=auto svn
[root@localhost conf]# kill -9 7637


10、在windows上测试

   输入SVN地址,如下图:

   104438_UQV7_868835.png

   输入用户名、密码即可

   

转载于:https://my.oschina.net/heensenxi/blog/1204180

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值