




CentOS 5.5下搭建部署独立SVN服务器全程详解
SVN服务器有2种运行方式:
1、独立服务器 (例如:svn://xxx.com/xxx);
2、借助apache (例如:http://svn.xxx.com/xxx);
为了不依赖apache,我选择第一种方式:独立的svn服务器。
SVN存储版本数据也有2种方式:
1、bdb;
2、fsfs。
由于bdb方式在服务器中断时,有可能锁住数据,所以还是fsfs方式更安全一点,我也选择这种方式。
具体部署:
1.下载subversion安装包
|
[root@server ~]# cd /usr/local/src |
| [root@server subversion-1.6.6]# find / -name opensslv.h [root@server subversion-1.6.6]# |
| [root@server subversion-1.6.6]# yum install openssl [root@server subversion-1.6.6]# yum install openssl-devel |
| [root@server subversion-1.6.6]# find / -name opensslv.h /usr/include/openssl/opensslv.h [root@server subversion-1.6.6]# ./configure --prefix=/usr/local/svn --with-openssl=/usr/include/openssl --without-berkeley-db |
| configure: WARNING: unrecognized options: --with-openssl configure: Configuring Subversion 1.6.6 configure: creating config.nice checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/usr/local/src/subversion-1.6.6': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. |
| [root@server subversion-1.6.6]# yum -y install gcc [root@server subversion-1.6.6]# ./configure --prefix=/usr/local/svn --with-openssl=/usr/include/openssl --without-berkeley-db |
| 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 |
| error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory |
| /usr/local/lib |
| /sbin/ldconfig |
注:ld.so.conf和ldconfig用于维护系统动态链接库。
安装
[root@server subversion-1.6.6]# make && make install
安装完成,执行以下命令测试: [root@server subversion-1.6.6]# /usr/local/svn/bin/svnserve --version 版权所有 (C) 2000-2009 CollabNet。 下列版本库后端(FS) 模块可用: * fs_fs : 模块与文本文件(FSFS)版本库一起工作。
svnserve,版本 1.6.6 (r40053)
编译于 Feb 15 2012,22:15:26
Subversion 是开放源代码软件,请参阅 http://subversion.tigris.org/ 站点。
此产品包含由 CollabNet(http://www.Collab.Net/) 开发的软件。
为了方便下操作,下面将SVN的BIN添加到PATH,编辑/etc/profile,添加:
| PATH=/usr/local/svn/bin:$PATH |
| source /etc/profile |
|
[root@server ~]# mkdir -p /home/svndata/repos #建立版本库 |
| [general] anon-access = none auth-access = write password-db = /usr/local/svn/conf/passwd.conf authz-db = /usr/local/svn/conf/authz.conf realm = repos |
|
mkdir conf |
|
[root@server ~]# useradd wll |
| [users] wll = 123456 |
|
[groups] 注意: |
| [root@server ~]# useradd svn [root@server ~]# passwd svn |
| [root@server ~]# chown -R svn:svn /home/svndata |
|
[root@server ~]# su - svn -c "svnserve -d --listen-port 9999 -r /home/svndata" 其中: |
| /usr/local/svn/bin/svnserve -d --listen-port 9999 -r /home/svndata |
| killall svnserve |
| #!/bin/bash # build this file in /etc/rc.d/init.d/svn # chmod 755 /etc/rc.d/init.d/svn # centos下可以用如下命令管理svn: service svn start(restart/stop) SVN_HOME=/home/svndata if [ ! -f "/usr/local/svn/bin/svnserve" ] then echo "svnserver startup: cannot start" exit fi case "$1" in start) echo "Starting svnserve..." /usr/local/svn/bin/svnserve -d --listen-port 9999 -r $SVN_HOME echo "Finished!" ;; stop) echo "Stoping svnserve..." killall svnserve echo "Finished!" ;; restart) $0 stop $0 start ;; *) echo "Usage: svn { start | stop | restart } " exit 1 esac |
|
svn://192.168.1.87:9999/repos |
本文出自 “300second的运维小站” 博客,请务必保留此出处http://300second.blog.51cto.com/7582/780348
10人 |
了这篇文章 |