一、安装
1、依赖库安装
# yum install -y gcc gcc-c++
# yun install -y zlib zlib-devel openssl openssl-devel
# yum install -y openssl openssl-devel
# yum install -y libxml2 libxml2-dev
# yum install -y libssl-dev
# yum install -y curl libcurl4-openssl-dev
# yum install -y libpcre3 libpcre3-dev
# yum install -y libgd-dev
# yum install nghttp2
# yum install zliblg-dev
# yum install libutf8proc-dev
# yum install zip unzip
# yum install expat-devel(apr-util error)
2、文件下载
# wget http://mirrors.hust.edu.cn/apache/subversion/subversion-1.10.0.tar.gz
# tar zxvf subversion-q.10.0.tar.gz
3、 sqlite依赖安装
# wget https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip
# unzip sqlite-amalgamation-3240000.zip
# mv sqlite-amalgamation-3240000 subversion-1.10.0/sqlite-amalgamation
4、apr依赖安装
# wget http://mirrors.shu.edu.cn/apache//apr/apr-1.6.3.tar.gz
# tar zxf apr-1.6.3.tar.gz
# cd apr-1.6.3
# ./configure --prefix=/opt/apr
# make
# make install
5、apr-util依赖安装
# wget http://mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
# tar zxf apr-util-1.6.1.tar.gz
# cd apr-util-1.6.1
# ./configure --prefix=/opt/apr-util --with-apr=/opt/apr
# make
# make install
6、安装配置
# cd subversion-1.10.0
# ./configure --prefix=/usr/local/svn --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-lz4=internal --with-utf8proc=internal
# make
# make install
7、检测
# cd /usr/local/svn
# ./bin/svn --version
二、配置
1、配置环境变量
# vi /etc/profile
输入:
#svn
SVN_HOME=/url/local/svn
export PATH=$PATH:$SVN_HOME/bin
# source /etc/profile(刷新设置,避免重启)
# echo $PATH(查看设置是否生效)
2、启动服务
# /usr/local/svn/bin/svnserve -d -r /var/svn
3、配置开机自启动
# vi /etc/rc.d/rc.local
# /usr/local/svn/bin/svnserve -d -r /var/svn
4、防火墙开启端口3690
3.1 查看防火墙端口状态
# firewall-cmd--state
3.2 添加端口3690
# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3690 -j ACCEPT
3.3 重启防火墙
# systemctl restart iptables.service
5、客户端访问svn服务器
在windows客户端,输入地址:svn://ip地址:3690/xxxx (iP地址为你linux的ip,xxxx为前文创建的版本库名称,3690为svn默认端口)
弹出输入用户名和密码,输入即可访问。