---------安装操作步骤 Wolkin 2021-09-07--------------
SVN服务端安装部署在Linux服务器,详细安装操作步骤记录,个人工作中实际操作步骤记录以及各软件安装过程命令和异常解决操作步骤,分享给大家,希望对大家有一点帮助。
1、安装文件包
apr-1.7.0.tar.gz (SVN基础依赖包)
apr-util-1.6.1.tar.gz (SVN基础依赖包)
sqlite-autoconf-3330000.tar.gz (数据依赖包)
subversion-1.14.1.tar.gz (SVN主要安装包)
zlib-1.2.11.tar.xz (SVN基础依赖包)
2、减压安装包文件
tar -xvzf apr-1.7.0.tar.gz
tar -xvzf apr-util-1.6.1.tar.gz
tar -xvzf sqlite-autoconf-3330000.tar.gz
tar -xvzf subversion-1.14.1.tar.gz
xz -d zlib-1.2.11.tar.xz
tar -xvf zlib-1.2.11.tar
3、安装apr-1.7.0
cd /home/SVN/apr-1.7.0
./configure --prefix=/home/SVN/apr-1.7.0 (配置编译路劲,需要具备gcc编译命令)
3.1、补充操作
安装gcc_rpm安装包
重新执行:./configure --prefix=/home/SVN/apr-1.7.0(异常rm: cannot remove `libtoolT': No such file or directory)
3.1.1、补充操作
sudo vi configure (找到RM='$RM'修改为RM='$RM -f')
重新执行:./configure --prefix=/home/SVN/apr-1.7.0 成功
make
make install
4、安装apr-util-1.6.1
cd /home/SVN/apr-util-1.6.1
./configure --prefix=/home/SVN/apr-util-1.6.1 --with-apr=/home/SVN/apr-1.7.0
make (异常:make[1]: Leaving directory `/home/SVN/apr-util-1.6.1')
4.1、补充操作
安装expat_devel,下载expat_2.0.1.orig.tar.gz
tar -xvzf expat_2.0.1.orig.tar.gz
cd expat_2.0.1.orig
./configure
make
make install
重新执行:./configure --prefix=/home/SVN/apr-util-1.6.1 --with-apr=/home/SVN/apr-1.7.0
make
make install
5、安装zlib
cd /home/SVN/zlib-1.2.11
./configure --prefix=/home/SVN/zlib-1.2.11
make
make install
6、移动sqllite文件
cd /home/SVN
mv sqlite-autoconf-3330000 /home/SVN/subversion-1.14.1
改名sqlite-amalgamation
7、安装subversion
cd /home/SVN/subversion-1.14.1
./configure prefix=/home/SVN/subversion-1.14.1 --with-apr=/home/SVN/apr-1.7.0 --with-apr-util=/home/SVN/apr-util-1.6.1 --with-zlib=/home/SVN/zlib-1.2.11 --with-lz4=internal --with-utf8proc=internal
make
make install
8、配置profile
vi /etc/profile
export PATH=$PATH:/home/SVN/subversion-1.14.1/bin
source /etc/profile
9、验证
svnserve --version
10、配置仓库
10.1、创建版本库目录
cd /home/SVN
mkdir -p SVNRepository
svnadmin create /home/SVN/SVNRepository
10.2、修改配置文件
cd /home/SVN/SVNRepository/conf
vi svnserve.conf
参数:[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = LS First Repository
11、配置用户
cd /home/SVN/SVNRepository/conf
vi passwd
举例:[users]
harry = harryssecret (密码明文)
sally = sallyssecret (密码明文)
12、配置用户权限
cd /home/SVN/SVNRepository/conf
vi authz
举例:[groups]
harry_and_sally = harry,sally
harry_sally_and_joe = harry,sally,&joe
[/foo/bar]
harry = rw
&joe = r
* =
[repository:/baz/fuz]
@harry_and_sally = rw
* = r
13、启动服务
方法一、svnserve -d -r /home/SVN/SVNRepository #默认端口3690 svn://***.***.***.***
方法二、svnserve -d -r /home/SVN #默认端口3690 svn://***.***.***.***/SVNRepository
ps -ef|grep svn
14、开通防火墙端口
cd /etc/sysconfig
vi iptables
添加:-A INPUT -p tcp -m tcp --dport 3690 -j ACCEPT
15、重启防火墙
service interface srestart