现在的位置: 首页 > 综合 > 正文

Linux subversion安装配置迁移

2014年09月05日 ⁄ 综合 ⁄ 共 3328字 ⁄ 字号 评论关闭

Linux subversion安装配置迁移

背景介绍:

       因公司windows的服务器硬盘(RAID 1)坏掉一个,windows 系统无法进入,按理RAID 1不会出现这种情况,很大的可能是之前的系统工程师没有把两块硬盘做成RAID 1而是直接挂上去的(有数据丢失),所以大佬决定把服务器用Linux重装,并在服务器上安装测试环境数据库,SVN版本控制。
一、安装前需要准备的工具包

apr-1.5.0.tar.gz

apr-util-1.5.3.tar.gz

subversion-1.8.8.tar.gz

相关资源下载:http://download.csdn.net/detail/javaee_ssh/7033449

注:我是从官网下载的最新版本,也可以通过安装光盘中找到相应的包
例:

[root@oracle RHEL_6.3 x86_64 Disc 1]# pwd
/media/RHEL_6.3 x86_64 Disc 1
[root@oracle RHEL_6.3 x86_64 Disc 1]# find. -name apr*.rpm
./Packages/apr-1.3.9-3.el6_1.2.i686.rpm
./Packages/apr-1.3.9-3.el6_1.2.x86_64.rpm
./Packages/apr-devel-1.3.9-3.el6_1.2.i686.rpm
./Packages/apr-devel-1.3.9-3.el6_1.2.x86_64.rpm
./Packages/apr-util-1.3.9-3.el6_0.1.i686.rpm
./Packages/apr-util-1.3.9-3.el6_0.1.x86_64.rpm
./Packages/apr-util-devel-1.3.9-3.el6_0.1.i686.rpm
./Packages/apr-util-devel-1.3.9-3.el6_0.1.x86_64.rpm
./Packages/apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm

  
二.安装
1.apr安装
解压apr-1.5.0.tar.gz

./configure
make
make install

2.安装apr-util
解压apr-util-1.5.3.tar.gz

./configure--with-apr=/usr/subversion/apr-1.5.0
make
make install

3.安装subversion

./configure--with-apr=/usr/subversion/apr-1.5.0--with-apr-util=/usr/subversion/apr-util-1.5.3
make
make install

4.检查安装成功与否
执行svnserve --version 如果显示出了版本信息说明安装成功。
 
安装后之后会在/usr/local/bins生成相关svn的命令

[root@oracle bin]# pwd
/usr/local/bins
[root@oracle bin]# ls
coraenv oraenv  svnadmin       svnlook svnrdump  svnsync
dbhome  svn     svndumpfilter  svnmucc svnserve  svnversion

 三、安装过程中可能会遇到的异常
1

configure: WARNING: APR not found
The Apache Portable Runtime (APR) librarycannot be found.
Please install APR on this system andconfigure Subversion
with the appropriate --with-apr option.

解决办法:添加第2,3步

 2

</pre><pre code_snippet_id="233186" snippet_file_name="blog_20140313_7_5423746" name="code" class="plain">.sqlite 3.7.15.1 amalgamation from:

http://www.sqlite.org/sqlite-amalgamation-3071501.zip

unpack the archive using unzip and renamethe resulting
directory to:
/usr/subversion/subversion-1.8.8/sqlite-amalgamation

解决办法:下载解压并重命名为sqlite-amalgamation
 
3

configure:error: subversion requires zlib

解决办法:从官网下载zlib安装即可,安装步骤同2,3
 
四.Svn相关配置
1.创建库

svnadmin create subversion/my-repos
svnadmin create subversion/test

2.导入文件

svn import apr-1.5.0 file:///root/apr-1.5.0

3.修改 svnserve.conf

anon-access=none //不允许匿名用户访问
auth-access = write//允许有权限用户进行修改
password-db = passwd //指定用户配置文件
authz-db = authz //指定权限配置
realm = My First Repository //客户端连接时的版本注释,可选 

4.修改 passwd

[users]
# harry = harryssecret
# sally = sallyssecret
wyl = wyl

5.修改  authz
添加

[my-repos:/]
wyl = rw

注:注意空格问题,
例:
anon-access=none 正确 
 anon-access=none 错误
6.启动svn

svnserve -d -r /root/subversion

7.windows客户端连接
  

五.多个版本库用户、权限配置

例如:/home/svn/repositories 目录下有多个版本库cmmi,department

1.拷贝authz 与passwd文件至/home/svn/repositories

2.修改/home/svn/repositories/cmmi/config/svnserve.conf

  修改/home/svn/repositories/department/config/svnserve.conf

  password-db = ../../passwd
  authz-db = ../../authz

3.编辑auth文件

例:

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
dept1=liumeilin,wyl,wxc,zw,lml,lby,flf,lxr,lh,xcz,wws,xcq
# [/foo/bar]
# harry = rw
# &joe = r
# * =
 
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[cmmi:/]
liumeilin=rw
*=r
[project:/]
*=r
@dept1=rw
[knowledge:/]
*=r

五.其它

1.有关svn的迁移

svn有两种方式可以迁移

1.1、直接cope svn库文件夹。

1.2、通过svn dump导出,然后再通过导入。

我是通过cope svn的方式将windows的svn库迁移至linux

2.有关subversion安装方式

目前网上有关subversion安装方式主要是基于yum与下载subversion安装文件两种方式。 

3.1.6.9版本svn

1.6.9以前的版本apache都提供了依赖的包,不清楚为何之后不再提供依赖包了。所以我们看到网上有很多的博客有写下载subversion,及依赖包

subversion-deps-1.6.9.tar.gz 

历史版本及依赖包:http://archive.apache.org/dist/subversion/

文章如果对你有帮助,请点击打开链接

抱歉!评论已关闭.