Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12397887
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: C/C++

2011-06-24 09:50:57

 

1、环境

 

vmware fedora10

 

2、操作步骤

 

image

 

2.1 取上面两个包,解压

 

   注意!这两个包的名字需要对应。不然容易出现莫名的错误。

 

  1. [root@localhost svn_all]# ls
  2. subversion-1.6.13.tar.gz subversion-deps-1.6.13.tar.gz svn_server
  3. [root@localhost svn_all]# tar xfvz subversion-1.6.13.tar.gz [root@localhost svn_all]# tar xfvz subversion-deps-1.6.13.tar.gz

 

    解压后,两个压缩包的内容都加解压到subversion-1.6.13目录。

 

  1. [root@localhost svn_all]# ls
  2. subversion-1.6.13 subversion-deps-1.6.13.tar.gz
  3. subversion-1.6.13.tar.gz svn_server_dir

 

2.2 接下来的是配置及安装的重头戏了

 

  1. [root@localhost svn_all]# cd subversion-1.6.13

  2. [root@localhost subversion-1.6.13]# ./configure --prefix=/home/svn_all/svn_server_dir/

  3. [root@localhost subversion-1.6.13]# make

  4. [root@localhost subversion-1.6.13]# make install

 

3 最重要的配置及测试

 

3.1 添加SVN服务器的环境变量

 

  1. [root@localhost svn_server_dir]# vim /etc/profile

  2. +++++

  3. SVNPATH=$PATH:/home/svn_all/svn_server_dir/bin
  4. export SVNPATH

  5. ++++

  6. export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

 

3.2 测试SVN-SERVER是否安装成功!

 

  1. [root@localhost svn_server_dir]# svnserve --version
  2. svnserve,版本 1.6.5 (r38866)
  3.    编译于 Sep 10 2009,16:04:08

  4. 版权所有 (C) 2000-2009 CollabNet。
  5. Subversion 是开放源代码软件,请参阅 http://subversion.tigris.org/ 站点。

  6. 此产品包含由 CollabNet(http://) 开发的软件。


  7. 下列版本库后端(FS) 模块可用:

  8. * fs_base : 模块只能操作BDB版本库。
  9. * fs_fs : 模块与文本文件(FSFS)版本库一起工作。

  10. Cyrus SASL 认证可用。

  11. [root@localhost svn_server_dir]#

 

3.3 配置的关键过程

 

3.3.1 创建重要目录

 

  1. [root@localhost svn_all]# mkdir -p /home/svn_all/svndata/repos
  2. [root@localhost svn_all]# ls
  3. subversion-1.6.13 subversion-1.6.13.tar.gz subversion-deps-1.6.13.tar.gz svndata svn_server_dir
  4. [root@localhost svn_all]# svnadmin create /home/svn_all/svndata/repos/
  5. [root@localhost svn_all]# ls svndata/repos/
  6. conf db format hooks locks README.txt
  7. [root@localhost svn_all]#

 

3.3.2 严格按照下面配置单,配置下面几个文件

 

(1)、svnserve.conf主配置文件

 

[root@localhost svn_all]# vim svndata/repos/conf/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 directory containing
  10. ### this configuration file.
  11. ### If SASL is enabled (see below), this file will NOT be used.
  12. ### Uncomment the line below to use the default password file.
  13. password-db = passwd      #开启第三项
  14. ### password-db = /home/svn_all/svndata/repos/conf/p
  15. wd.conf
  16. ### The authz-db option controls the location of the authorization
  17. ### rules for path-based access control. Unless you specify a path
  18. ### starting with a /, the file's location is relative to the the
  19. ### directory containing this file. If you don't specify an
  20. ### authz-db, no path-based access control is done.
  21. ### Uncomment the line below to use the default authorization file.
  22. ### authz-db = authz ----//这个使用不当会出现错误:Authenticated failed
  23. ### This option specifies the authentication realm of the repository.
  24. ### If two repositories have the same authentication realm, they should
  25. ### have the same password database, and vice versa. The default realm
  26. ### is repository's uuid.
  27. ### realm = My First Repository

 

(2)、authz配置用户

 

[root@localhost svn_all]# vim svndata/repos/conf/authz

 

  1. [groups]

  2. +++++
  3. gonsin = dyli,zzr,lcj,lzg

  4. +++++
  5. # harry_and_sally = harry,sally
  6. # harry_sally_and_joe = harry,sally,&joe

  7. # [/foo/bar]

  8. +++++
  9. dyli = rw
  10. zzr = rw
  11. lcj = rw
  12. lzg = rw

  13. +++++
  14. # harry = rw
  15. # &joe = r
  16. # * =

 

(3)、passwd 配置密码

 

[root@localhost svn_all]# vim svndata/repos/conf/passwd

  1. [users]

  2. ++++++  begin

  3. dyli = dyli
  4. zzr = zzr
  5. lcj = lcj
  6. lzg =lzg

  7. ++++++  end
  8. # harry = harryssecret
  9. # sally = sallyssecret

 

(4) 配置SVN自启动

 

[root@localhost linux-2.6.30.4]# vim /etc/rc.local

  1. touch /var/lock/subsys/local
  2. #svnserve -d -r /var/svn/repos

  3. +++++++++
  4. /home/svn_all/svn_server_dir/bin/svnserve -d -r /home/svn_all/svndata/repos/

  5. +++++++++

 

(5) 配置环境变量使SVN_EDITOR永远有效

 

[root@localhost gonsin_lcd]# vim ~/.bashrc

 

  1. export PATH=$PATH:/opt/EmbedSky/4.3.3/bin

  2. +++++

  3. export SVN_EDITOR=vim

  4. +++++

 

[root@localhost gonsin_lcd]# source ~/.bashrc

 

3.4 dyli的实战测试过程

 

3.4.1 向SVN导入文件

 

  1. [root@localhost svn_all]# svn import /project/daya-12864/lcd_12864/dayameeting-12864 file:///home/svn_all/svndata/repos/dayameeting-12864


  2. 日志信息未修改,或未指定
  3. a)终止,c)继续,e)编辑:
  4. c

 

3.4.2 从SVN下载文件

 

  1. [root@localhost svn_all]# svn co svn://192.168.1.180/gonsin_lcd

  2. A gonsin_lcd/tar.sh
  3. A gonsin_lcd/.built-in.o.cmd
  4. A gonsin_lcd/.lcd_12864.mod.o.cmd
  5. A gonsin_lcd/lcd_test
  6. A gonsin_lcd/lcd_test/tar.ch
  7. A gonsin_lcd/lcd_test/lcd_test
  8. A gonsin_lcd/lcd_test/lcd_test.c
  9. A gonsin_lcd/lcd_test/Makefile
  10. A gonsin_lcd/modules.order
  11. A gonsin_lcd/.lcd_12864.o.cmd
  12. A gonsin_lcd/.tmp_versions
  13. A gonsin_lcd/.tmp_versions/lcd_12864.mod
  14. A gonsin_lcd/lcd_12864.c
  15. A gonsin_lcd/lcd_128641.c
  16. A gonsin_lcd/Module.symvers
  17. A gonsin_lcd/lcd_12864.h
  18. A gonsin_lcd/Makefile
  19. A gonsin_lcd/.lcd_12864.ko.cmd
  20. 取出版本 3。
  21. [root@localhost svn_all]#

 

3.4.3 删除SVN工程目录

 

  1. [root@localhost home]# svn delete svn://192.168.1.180/gonsin_lcd


  2. 日志信息未修改,或未指定
  3. a)终止,c)继续,e)编辑:
  4. c

  5. 提交后的版本为 6。
  6. [root@localhost home]#

  7. [root@localhost home]# svn co svn://192.168.1.180/gonsin_lcd

  8. svn: URL “svn://192.168.1.180/gonsin_lcd” 不存在

  9. [root@localhost home]#

 

   经过dyli的努力测试,本SVN服务器搭建成功!感谢dyli的努力以及搭建SVN的先驱们,向你们致敬!

 

 

 

 

 

 

 

 

 

 

阅读(3574) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~