如何在linux上安装svn服务器

2024-11-01 00:21:40
推荐回答(1个)
回答1:

你好,centos下安装 svn 1.9.5 按照步骤一步一步装就OK 。以下是我的步骤。分享给你
安装1.9
准备工作:
1、安装编译工具包
yum install apr* autoconf automake bison bzip2 cloog-ppl compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng* libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool libtool* libgomp libxml2 libxml2-devel libXpm* libtiff libtiff* libX* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils ppl telnet t1lib t1lib* nasm nasm* wget zlib-devel zlib unzip perl-ExtUtils-Embed
2、yum remove apr apr-util subversion subversion-libs #删除系统中原有的svn及依赖包
3、下载软件包
https://dist.apache.org/repos/dist/release/apr/apr-1.5.2.tar.gz
https://dist.apache.org/repos/dist/release/apr/apr-util-1.5.4.tar.gz
http://prdownloads.sourceforge.net/scons/scons-2.3.5.tar.gz
http://www.openssl.org/source/openssl-1.0.1o.tar.gz
https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2
http://www.apache.org/dist/subversion/subversion-1.8.13.tar.gz
http://www.sqlite.org/2017/sqlite-amalgamation-3160200.zip

1、安装apr
cd /usr/local/src #进入软件包存放目录
tar zxvf apr-1.5.2.tar.gz #解压
cd apr-1.5.2 #进入安装目录
./configure --prefix=/usr/local/apr #配置
make #编译
make install #安装

2、安装apr-util
cd /usr/local/src
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make && make install

3、安装scons
cd /usr/local/src
tar zxvf scons-2.3.5.tar.gz
cd scons-2.3.5
python setup.py install #配置安装

4、安装openssl
cd /usr/local/src
tar zxvf openssl-1.0.1o.tar.gz
cd openssl-1.0.1o
CFLAGS=-fPIC ./config --prefix=/usr/local/openssl enable-shared
make && make install
vi /etc/profile #添加系统环境变量
export PATH=$PATH:/usr/local/openssl/bin >> /etc/profile
#export PATH=$PATH:/usr/local/openssl/bin >> /etc/profile
:wq! #保存退出
source /etc/profile #使配置生效
ln -s /usr/local/openssl/include/openssl /usr/include/openssl #添加系统软连接
5、安装serf
cd /usr/local/src
tar -xf serf-1.3.9.tar.bz2
cd serf-1.3.9
scons PREFIX=/usr/local/serf APR=/usr/local/apr/bin/apr-1-config APU=/usr/local/apr/bin/apu-1-config OPENSSL=/usr/local/openssl
scons install
cd /usr/local/serf/lib
cp libserf-1.so* /usr/local/lib/ #拷贝文件到系统目录

6、安装svn
cd /usr/local/src
tar zxvf subversion-1.9.5.tar.gz
cd subversion-1.9.5
mkdir /usr/local/src/subversion-1.9.5/sqlite-amalgamation #创建sqlite-amalgamation目录
cd /usr/local/src
unzip sqlite-amalgamation-3160200.zip -d /usr/local/src/subversion-1.9.5/sqlite-amalgamation
mv /usr/local/src/subversion-1.9.5/sqlite-amalgamation/sqlite-amalgamation-3160200/* /usr/local/src/subversion-1.9.5/sqlite-amalgamation
#解压sqlite-amalgamation软件包到sqlite-amalgamation目录
cd /usr/local/src/subversion-1.9.5
./configure --prefix=/usr/local/svn --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config --with-serf=/usr/local/serf --with-openssl=/usr/local/openssl --enable-mod-activation #配置
make #编译
make install #安装
vi /etc/profile #添加系统环境变量,添加到最后一行
export PATH=$PATH:/usr/local/svn/bin
:wq! #保存退出
source /etc/profile #使配置立刻生效
whereis libexpat.so.1 #查找文件安装目录,如下:
libexpat.so: /lib/libexpat.so.0 /usr/local/lib/libexpat.so /usr/local/lib/libexpat.so.1
vi /etc/ld.so.conf #编辑加入libexpat.so.1的目录
/usr/local/lib/
:wq! #保存退出
ldconfig #使配置生效