标签:svn svn安装 安装svn 部署svn svn部署
安装SVN
系统环境
[root@node1 ~]# uname -rm
2.6.32-504.el6.x86_64 x86_64
[root@node1 ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
安装apr
[root@node1 ~]# cd /softs/
[root@node1 softs]# wge thttp://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz
[root@node1 softs]# tar xf apr-1.5.2.tar.gz
[root@node1 softs]# cd apr-1.5.2
[root@node1 apr-1.5.2]#./configure
[root@node1 apr-1.5.2]# make
[root@node1 apr-1.5.2]# make install
[root@node1 apr-1.5.2]# cd
安装apr-util
root@node1 ~]# cd /softs/
[root@node1 softs]# wge thttp://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
[root@node1 softs]# tar xf apr-util-1.5.4.tar.gz
[root@node1 softs]# cd apr-util-1.5.4
[root@node1 apr-util-1.5.4]#./configure --with-apr=/usr/local/apr/
[root@node1 apr-util-1.5.4]#make
[root@node1 apr-util-1.5.4]#make install
[root@node1 apr-util-1.5.4]#cd
安装zlib
[root@node1 ~]# cd /softs/
[root@node1 zlib-1.2.8]#wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz
[root@node1 zlib-1.2.8]#./configure
[root@node1 zlib-1.2.8]#make
[root@node1 zlib-1.2.8]#make install
[root@node1 zlib-1.2.8]# cd
安装svn
[root@node1 ~]# cd /softs/
[root@node1 softs]# wget http://mirror.23media.de/apache/subversion/subversion-1.9.3.tar.gz
[root@node1 softs]# wget http://www.sqlite.org/2016/sqlite-amalgamation-3130000.zip
[root@node1 softs]# tar xf subversion-1.9.3.tar.gz
[root@node1 softs]# unzip sqlite-amalgamation-3130000.zip
[root@node1 softs]# cp -r sqlite-amalgamation-3130000 subversion-1.9.3/sqlite-amalgamation
[root@node1 softs]# cd subversion-1.9.3
[root@node1subversion-1.9.3]# ./configure --prefix=/app/subversion-1.9.3 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr/
[root@node1subversion-1.9.3]# make
[root@node1subversion-1.9.3]# make install
[root@node1subversion-1.9.3]# ln -s /app/subversion-1.9.3/ /app/subversion
[root@node1subversion-1.9.3]# cd
配置环境变量
[root@node1 ~]# sed -i‘$a\export PATH=/app/subversion/bin:$PATH‘ /etc/profile
[root@node1 ~]# source/etc/profile
[root@node1 ~]# svn --version
svn, version 1.9.3(r1718519)
compiled Jun 14 2016, 01:44:46 onx86_64-unknown-linux-gnu
。。。剩余省略。。。
建立仓库
[root@node1 ~]# mkdir/repertory //所有仓库的根目录
[root@node1 ~]# svnadmin create /repertory/web/
[root@node1 ~]# ls /repertory/web/
conf db format hooks locks README.txt
[root@node1 ~]# cd /repertory/web/conf/
[root@node1 conf]# tree
.
├── authz //权限控制文件
├── hooks-env.tmpl
├── passwd //用户密码文件
└── svnserve.conf //配置文件
0 directories, 4 files
配置仓库
配置基础配置
[root@node1 conf]# cp svnserve.conf svnserve.conf.bak
[root@node1 conf]# vim svnserve.conf
[general]
anon-access = none
anon-access = write
password-db = passwd
authz-db = authz
配置权限
[root@node1 conf]# cp authz authz.bak
[root@node1 conf]# vim authz
[groups]
admin = kevinhao
[web:/]
@admin = rw
kevinhao = rw
配置账户密码
[root@node1 conf]# cp passwd passwd.bak
[root@node1 conf]# vim passwd
[users]
kevinhao = 123456
[root@node1 conf]# cd
启动svn
[root@node1 ~]# svnserve -d-r /repertory/
[root@node1 ~]# lsof -i:3690
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODENAME
svnserve 95029 root 3u IPv4 77157 0t0 TCP *:svn (LISTEN)
测试
[root@node1 ~]# svn info --username=kevinhao --password 123456 svn://192.168.56.3/web
Path: web
URL: svn://192.168.56.3/web
Relative URL: ^/
Repository Root:svn://192.168.56.3/web
Repository UUID:357d6d18-31b8-11e6-a0bc-db0060075f0b
Revision: 0
Node Kind: directory
Last Changed Rev: 0
Last Changed Date:2016-06-14 06:43:12 +0800 (Tue, 14 Jun 2016)
本文出自 “长街听风人” 博客,请务必保留此出处http://kevinhao.blog.51cto.com/5204735/1788950
标签:svn svn安装 安装svn 部署svn svn部署
原文地址:http://kevinhao.blog.51cto.com/5204735/1788950