1、环境
vmware fedora10
2、操作步骤
2.1 取上面两个包,解压
注意!这两个包的名字需要对应。不然容易出现莫名的错误。
- [root@localhost svn_all]# ls
- subversion-1.6.13.tar.gz subversion-deps-1.6.13.tar.gz svn_server
- [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目录。
- [root@localhost svn_all]# ls
- subversion-1.6.13 subversion-deps-1.6.13.tar.gz
- subversion-1.6.13.tar.gz svn_server_dir
2.2 接下来的是配置及安装的重头戏了
- [root@localhost svn_all]# cd subversion-1.6.13
- [root@localhost subversion-1.6.13]# ./configure --prefix=/home/svn_all/svn_server_dir/
- [root@localhost subversion-1.6.13]# make
- [root@localhost subversion-1.6.13]# make install
3 最重要的配置及测试
3.1 添加SVN服务器的环境变量
- [root@localhost svn_server_dir]# vim /etc/profile
- +++++
- SVNPATH=$PATH:/home/svn_all/svn_server_dir/bin
- export SVNPATH
- ++++
- export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
3.2 测试SVN-SERVER是否安装成功!
- [root@localhost svn_server_dir]# svnserve --version
- svnserve,版本 1.6.5 (r38866)
- 编译于 Sep 10 2009,16:04:08
- 版权所有 (C) 2000-2009 CollabNet。
- Subversion 是开放源代码软件,请参阅 http://subversion.tigris.org/ 站点。
- 此产品包含由 CollabNet(http://www.Collab.Net/) 开发的软件。
- 下列版本库后端(FS) 模块可用:
- * fs_base : 模块只能操作BDB版本库。
- * fs_fs : 模块与文本文件(FSFS)版本库一起工作。
- Cyrus SASL 认证可用。
- [root@localhost svn_server_dir]#
3.3 配置的关键过程
3.3.1 创建重要目录
- [root@localhost svn_all]# mkdir -p /home/svn_all/svndata/repos
- [root@localhost svn_all]# ls
- subversion-1.6.13 subversion-1.6.13.tar.gz subversion-deps-1.6.13.tar.gz svndata svn_server_dir
- [root@localhost svn_all]# svnadmin create /home/svn_all/svndata/repos/
- [root@localhost svn_all]# ls svndata/repos/
- conf db format hooks locks README.txt
- [root@localhost svn_all]#
3.3.2 严格按照下面配置单,配置下面几个文件
(1)、svnserve.conf主配置文件
[root@localhost svn_all]# vim svndata/repos/conf/svnserve.conf
- [general]
- ### These options control access to the repository for unauthenticated
- ### and authenticated users. Valid values are "write", "read",
- ### and "none". The sample settings below are the defaults.
- anon-access = read #开启第一项
- auth-access = write #开启第二项
- ### The password-db option controls the location of the password
- ### database file. Unless you specify a path starting with a /,
- ### the file's location is relative to the directory containing
- ### this configuration file.
- ### If SASL is enabled (see below), this file will NOT be used.
- ### Uncomment the line below to use the default password file.
- password-db = passwd #开启第三项
- ### password-db = /home/svn_all/svndata/repos/conf/p
- wd.conf
- ### The authz-db option controls the location of the authorization
- ### rules for path-based access control. Unless you specify a path
- ### starting with a /, the file's location is relative to the the
- ### directory containing this file. If you don't specify an
- ### authz-db, no path-based access control is done.
- ### Uncomment the line below to use the default authorization file.
- ### authz-db = authz ----//这个使用不当会出现错误:Authenticated failed
- ### This option specifies the authentication realm of the repository.
- ### If two repositories have the same authentication realm, they should
- ### have the same password database, and vice versa. The default realm
- ### is repository's uuid.
- ### realm = My First Repository
(2)、authz配置用户
[root@localhost svn_all]# vim svndata/repos/conf/authz
- [groups]
- +++++
- gonsin = dyli,zzr,lcj,lzg
- +++++
- # harry_and_sally = harry,sally
- # harry_sally_and_joe = harry,sally,&joe
- # [/foo/bar]
- +++++
- dyli = rw
- zzr = rw
- lcj = rw
- lzg = rw
- +++++
- # harry = rw
- # &joe = r
- # * =
(3)、passwd 配置密码
[root@localhost svn_all]# vim svndata/repos/conf/passwd
- [users]
- ++++++ begin
- dyli = dyli
- zzr = zzr
- lcj = lcj
- lzg =lzg
- ++++++ end
- # harry = harryssecret
- # sally = sallyssecret
(4) 配置SVN自启动
[root@localhost linux-2.6.30.4]# vim /etc/rc.local
- touch /var/lock/subsys/local
- #svnserve -d -r /var/svn/repos
- +++++++++
- /home/svn_all/svn_server_dir/bin/svnserve -d -r /home/svn_all/svndata/repos/
- +++++++++
(5) 配置环境变量使SVN_EDITOR永远有效
[root@localhost gonsin_lcd]# vim ~/.bashrc
- export PATH=$PATH:/opt/EmbedSky/4.3.3/bin
- +++++
- export SVN_EDITOR=vim
- +++++
[root@localhost gonsin_lcd]# source ~/.bashrc
3.4 dyli的实战测试过程
3.4.1 向SVN导入文件
- [root@localhost svn_all]# svn import /project/daya-12864/lcd_12864/dayameeting-12864 file:///home/svn_all/svndata/repos/dayameeting-12864
- 日志信息未修改,或未指定
- a)终止,c)继续,e)编辑:
- c
3.4.2 从SVN下载文件
- [root@localhost svn_all]# svn co svn://192.168.1.180/gonsin_lcd
- A gonsin_lcd/tar.sh
- A gonsin_lcd/.built-in.o.cmd
- A gonsin_lcd/.lcd_12864.mod.o.cmd
- A gonsin_lcd/lcd_test
- A gonsin_lcd/lcd_test/tar.ch
- A gonsin_lcd/lcd_test/lcd_test
- A gonsin_lcd/lcd_test/lcd_test.c
- A gonsin_lcd/lcd_test/Makefile
- A gonsin_lcd/modules.order
- A gonsin_lcd/.lcd_12864.o.cmd
- A gonsin_lcd/.tmp_versions
- A gonsin_lcd/.tmp_versions/lcd_12864.mod
- A gonsin_lcd/lcd_12864.c
- A gonsin_lcd/lcd_128641.c
- A gonsin_lcd/Module.symvers
- A gonsin_lcd/lcd_12864.h
- A gonsin_lcd/Makefile
- A gonsin_lcd/.lcd_12864.ko.cmd
- 取出版本 3。
- [root@localhost svn_all]#
3.4.3 删除SVN工程目录
- [root@localhost home]# svn delete svn://192.168.1.180/gonsin_lcd
- 日志信息未修改,或未指定
- a)终止,c)继续,e)编辑:
- c
- 提交后的版本为 6。
- [root@localhost home]#
- [root@localhost home]# svn co svn://192.168.1.180/gonsin_lcd
- svn: URL “svn://192.168.1.180/gonsin_lcd” 不存在
- [root@localhost home]#
经过dyli的努力测试,本SVN服务器搭建成功!感谢dyli的努力以及搭建SVN的先驱们,向你们致敬!