centos搭建独立SVN服务器(一)

post by rocdk890 / 2012-3-23 10:03 Friday linux技术
  最近公司要转移svn,以前也只做过windows平台下的svn,早就想研究下linux下是怎么搭建svn的,今天就研究下怎么在linux平台下搭建svn,好了,废话不多说,看教程吧.
  系统:centos 5.6
  需要的软件:subversion-1.6.12 subversion-deps-1.6.12
1.下载subversion安装包之后解压,进入subversion目录

wget http://subversion.tigris.org/downloads/subversion-1.6.12.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.12.tar.gz
tar zxf subversion-1.6.12.tar.gz
tar zxf subversion-deps-1.6.12.tar.gz
cd subversion-1.6.12

2.编译安装svn
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng \
libpng-devel freetype freetype-devel libxml2 libxml2-devel \
zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 \
bzip2-devel ncurses ncurses-devel curl curl-devel ntsysv \
make openssl openssl-devel

./configure --prefix=/usr/local/svn --without-berkeley-db --with-apxs=no

注:以svnserve方式运行,不加apache编译参数.以fsfs格式存储版本库,不编译berkeley-db

如果最后出现下面WARNING,我们直接忽略即可.因为不使用BDB存储.

configure: WARNING: we have configured without BDB filesystem support

You don't seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL.We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end.You can find the latest version of
Berkeley DB here:

http://www.sleepycat.com/download/index.shtml

3.编译之后的安装

make && make install

如果make install出现下面错误:
error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

执行以下操作:

编辑/etc/ld.so.conf文件:
vi /etc/ld.so.conf
添加下面一行
/usr/local/lib
   
保存后运行ldconfig.
#/sbin/ldconfig

再重新运行make install 问题得到解决.
#make install

注:ld.so.conf和ldconfig用于维护系统动态链接库

至此,安装完成,执行以下命令测试

# /usr/local/svn/bin/svnserve --version

为了方便下操作,下面将SVN的BIN添加到PATH

#vi /etc/profile
PATH=/usr/local/svn/bin:$PATH

保存后,使其立即生效
#source /etc/profile

4.创建版本库

先新建个目录
mkdir /svnroot

svnadmin create /svnroot/repos
创建完版本库,开始配置svnserver.conf
我的路径是
vi /svnroot/repos/conf/svnserve.conf
[root@hexu.org]$ vi /data/svn/repos/conf/svnserve.conf
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[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
### 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
"/svnroot/repos/conf/svnserve.conf" 47L, 2279C
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[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
### 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
### 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

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256

ps:对用户配置文件的修改立即生效,不必重启svn
夜空- 本站版权
1、本站所有主题由该文章作者发表,该文章作者与夜空享有文章相关版权
2、其他单位或个人使用、转载或引用本文时必须同时征得该文章作者和夜空的同意
3、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
4、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
5、原文链接:blog.slogra.com/post-161.html

标签: centos 配置 安装 svn 搭建 服务器 独立

  1. gravatar ggb98
    2012-06-06 16:16
    支持一下。

评论: