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

搭建简单的SvnServe服务器

2018年04月30日 ⁄ 综合 ⁄ 共 2997字 ⁄ 字号 评论关闭



1
、安装篇:

我用的是
RHEL 4

32bit
),到
SVN
官网,最终你会在这个网址可供下载的
rpm
包:

 

http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/rhel4/i386/

 

本来嘛,有这个就够了:
subversion-1.5.5-1.i386.rpm

 

但是,安装它需要几个
dependencies
,也就是同目录下的 
apr-0.9.12-2.i386.rpm
, 
apr-util-0.9.12-1.i386.rpm

neon-0.27.2-1.i386.rpm
,把这几个先装了就搞定了,其他没什么好说的

 

2
、配置篇(
http://blog.csdn.net/hitzhang/archive/2009/08/23/4474925.aspx


 

为了方便进行hadoop开发和测试核自己控制,我在linux开发机上搭建了一个svnserve,没想到还费了挺多时间,汗

具体步骤如下,希望后来人可以节约点时间了

1. 安装subversion

我采用的方式是 sudo yum subversion

根据你的box的不同你可以采用不同的安装方式

2. 创建你的svn仓库文件目录

svnadmin create  /home/maosen/svnrepos

这时候就会在/home/maosen/svnrepos目录里面生成一系列的文件

  1. conf  dav  db  format  hooks  locks  README.txt  

3. 进行授权管理

根据你的需求可以进行不同的配置,我的配置如下:

svnserve.conf文件:

  1. [general]  
  2. ### These options control access to the repository for
     unauthenticated  
  3. ### and
     authenticated users.  Valid values are "write"
    "read"
    ,  
  4. ### and
     "none"
    .  The sample settings below are the defaults.  
  5. anon-access = read  
  6. auth-access = write  
  7. ### The password-db option controls the location of the password  
  8. ### database file.  Unless you specify a path starting with a /,  
  9. ### the file's location is relative to the conf directory.  
  10. ### Uncomment the line below to use
     the default
     password file.  
  11. password-db = passwd  
  12. ### The authz-db option controls the location of the authorization  
  13. ### rules for
     path-based access control.  Unless you specify a path  
  14. ### starting with a /, the file's location is relative to the conf  
  15. ### directory.  If you don't specify an authz-db, no path-based access  
  16. ### control is done.  
  17. ### Uncomment the line below to use
     the default
     authorization file.  
  18. authz-db = authz  

 

authz文件:

  1. [groups]  
  2. developer = maosen  
  3.   
  4. [/]  
  5. @developer = rw  
  6. * = r  
  7.   
  8. [repository:/home/maosen/dev/svnrepos]  
  9. @developer = rw  
  10. * = r  

passwd文件:

  1. [users]  
  2. maosen = 123456  

4. 载入你的代码

svn import dev/localsvn/hadoop-0.20.0/ file:///home/maosen/dev/svnrepos/hadoop-0.20.0
-m 'import'

5. 访问你的代码

svn co svn:///"hostname or ip"/hadoop-0.20.0 hadoop-0.20.0

完毕

 

三、使用篇

1
、建立好服务器后,可以重新删除
phpweb20
文件夹,并重新
checkout
命令:

#rm –fr /var/www/phpweb20

#svn checkout
svn://192.168.182.128/phpweb20

2
、使用过程中客户端更新后提交到服务器,服务器再
checkout
下来。

 

抱歉!评论已关闭.