Centos 6.5下SVN服务安装配置

本文详细介绍了如何在CentOS 6.5系统环境中搭建SVN服务器,包括安装Subversion、创建SVN仓库、配置用户认证及权限,并启动svnserve服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本文转自:http://jedy82.blog.51cto.com/425872/1395834

svn安装参考 http://blog.youkuaiyun.com/sxhong/article/details/9176881 
svn命令参考 http://blog.youkuaiyun.com/gexiaobaohelloworld/article/details/7752862

第一:说明,软件说明,和安装的目的 
架设基于linux下的SVN服务器,进行版本控制。

第二:本例操作环境 
所使用的系统环境为 Centos 6.5 64位操作系统

[root@tian ~]# uname -a 
Linux tian.test.com 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux 
[root@tian ~]# hostname 
tian.test.com 
[root@tian ~]# more /etc/redhat-release 
CentOS release 6.5 (Final) 
[root@tian ~]#

第三:服务器安装配置 
1.  安装必须的软件包
 
subversion

[root@tian ~]# yum install subversion -y 
[root@tian ~]# svnserve --version 
svnserve, version 1.6.11 (r934486) 
   compiled Mar  6 2014, 10:49:10

Copyright (C) 2000-2009 CollabNet. 
Subversion is open source software, see http://subversion.tigris.org/ 
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:

* fs_base : Module for working with a Berkeley DB repository. 
* fs_fs : Module for working with a plain file (FSFS) repository.

Cyrus SASL authentication is available.

有了SVN软件后还需要建立SVN库


2.创建svn仓库 
[root@tian ~]# 
[root@tian ~]# mkdir /svn 
[root@tian ~]# svnadmin create /svn 
执行上面的命令后,自动建立多个文件, 分别是conf, db, format, hooks, locks, README.txt。 
[root@tian ~]# ls /svn 
conf  db  format  hooks  locks  README.txt 
[root@tian ~]#

3.修改svn用户认证文件 
[root@tian ~]# cat /svn/conf/passwd | egrep -v "^#|^$"          
[users] 
tian = tian1234

4.修改svn用户权限控制文件 
[root@tian ~]# cat /svn/conf/authz | egrep -v "^#|^$"        
[aliases] 
[groups] 
[/] 
tian = wr 
[root@tian ~]#

5.修改svn服务器配置文件 
[root@tian ~]# cat /svn/conf/svnserve.conf | egrep -v "^#|^$"   
[general] 
anon-access = none # 使非授权用户无法访问 
auth-access = write # 使授权用户有写权限 
password-db = password 
authz-db = authz   # 访问控制文件 
realm = My First Repository # 描述 
[sasl] 
以上语句都必须顶格写, 左侧不能留空格, 否则会出错. 
[root@tian ~]#

第四:启动svnserve服务 
1.编辑服务进程文件/etc/init.d/svnserve 在最前面增加一行


OPTIONS=" -r /svn"

2.启动svnserve服务 
[root@tian ~]# service  svnserve restart 
Stopping svnserve:                                         [  OK  ] 
Starting svnserve:                                         [  OK  ] 
[root@tian ~]# 
[root@tian ~]# netstat -tlnp | grep svn 
tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN      3288/svnserve       
[root@tian ~]#

3.设置svn开机自启动 
[root@tian samba]# chkconfig svnserve on

当然也可以

好了,通过以上配置,你的svn就可以了。

第五:测试 
[root@tian ~]# svn co svn://127.0.0.1 svntest --username tian --password tian1234

----------------------------------------------------------------------- 
ATTENTION!  Your password for authentication realm:

   <svn://127.0.0.1:3690> My First Repository

can only be stored to disk unencrypted!  You are advised to configure 
your system so that Subversion can store passwords encrypted, if 
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value 
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in 
'/root/.subversion/servers'. 
----------------------------------------------------------------------- 
Store password unencrypted (yes/no)? yes 
A    svntest/Desktop.ini 
Checked out revision 1. 
[root@tian ~]# 
[root@tian ~]# touch svntest/test 
[root@tian ~]# svn update svntest/ 
At revision 1. 
[root@tian ~]# 
[root@tian ~]# svn add svntest/test 
A         svntest/test 
[root@tian ~]# svn ci -m "test" svntest/test 
Adding         svntest/test 
Transmitting file data . 
Committed revision 2. 
[root@tian ~]#

第六:补充

1.也可以不使用服务方式启svn 如下 
[root@tian ~]# svnserve -d -r /svn 
[root@tian ~]#


2.如果已经有svn在运行,可以换一个端口运行 
[root@tian ~]# svnserve -d -r /svn --listen-port 3391 
这样同一台服务器可以运行多个svnserver

好了,启动成功后,就可以使用了。

至此 所有配置完成


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值