Centos 6.5下SVN服务安装配置

类别:原创 服务器 linux

本文参考
svn安装参考 http://blog.csdn.net/sxhong/article/details/9176881
svn命令参考 http://blog.csdn.net/gexiaobaohelloworld/article/details/7752862服务器

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

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

[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 ~]# ide

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

subversion svn

[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/). this

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. .net

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

好了,启动成功后,就能够使用了。

至此 全部配置完成

相关文章
相关标签/搜索