SVN安装实战
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SVN安装实战相关的知识,希望对你有一定的参考价值。
一、安装准备
1.[[email protected] ~]# hostname svn 修改主机名
2.[[email protected] ~]# cat /etc/redhat-release 查看系统版本
CentOS release 6.5 (Final)
3.[[email protected] ~]# uname -a 查看内核版本
Linux svn 2.6.32-431.el6.i686 #1 SMP Fri Nov 22 00:26:36 UTC 2013 i686 i686 i386 GNU/Linux
二、开始安装
1.[[email protected] ~]# sed -i ‘s#keepcache=0#keepcache=1#g‘ /etc/yum.conf yum安装rpm包后本地不清除的rpm包的方法
2.[[email protected] ~]# grep keepcache /etc/yum.conf 检查yum安装本地不清除配置是否成功
keepcache=1
3.[[email protected] ~]# yum -y install subversion yum安装svn
4.[[email protected] ~]# rpm -qa subversion 检查安装是否成功
subversion-1.6.11-15.el6_7.i686
三、配置并启动svn
1.[[email protected] ~]# mkdir -p /application/svndata 建立svn版本库根目录svndata
2.启动svn服务指定服务的svn根目录
[[email protected] ~]# svnserve -d -r /application/svndata/ --pid- file=/application/svndata/svn.pid 指定svn服务启动的目录及pid文件
3.[[email protected] ~]# lsof -i :svn 检查配置
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
svnserve 1370 root 3u IPv4 23064 0t0 TCP *:svn (LISTEN)
[[email protected] ~]# lsof -i :3690 查看svn是否启动
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
svnserve 1370 root 3u IPv4 23064 0t0 TCP *:svn (LISTEN)
[[email protected] ~]# netstat -tlnup | grep svn
[[email protected] ~]# netstat -tlnup | grep 3690
4.[[email protected] ~]# svnserve --help 查看帮助
usage: svnserve [-d | -i | -t | -X] [options]
Valid options:
-d [--daemon] : daemon mode
-i [--inetd] : inetd mode
-t [--tunnel] : tunnel mode
-X [--listen-once] : listen-once mode (useful for debugging)
-r [--root] ARG : root of directory to serve
-R [--read-only] : force read only, overriding repository config file
--config-file ARG : read configuration from file ARG
--listen-port ARG : listen port
[mode: daemon, listen-once]
--listen-host ARG : listen hostname or IP address
[mode: daemon, listen-once]
-T [--threads] : use threads instead of fork [mode: daemon]
--foreground : run in foreground (useful for debugging)
[mode: daemon]
--log-file ARG : svnserve log file
--pid-file ARG : write server process ID to file ARG
[mode: daemon, listen-once]
--tunnel-user ARG : tunnel username (default is current uid‘s name)
[mode: tunnel]
-h [--help] : display this help
--version : show program version information
5.[[email protected] svndata]# svnadmin create /application/svndata/sadoc 创建一个新Subversion项目sadoc
6.配置允许tangbo用户读写访问
[[email protected] conf]# vim svnserve.conf
anon-access = read 修改为none
auth-access = write 启用
password-db = /application/svnpasswd/passwd
authz-db = /application/svnpasswd/authz
sed快速修改法:
[[email protected] conf]# sed -i ‘s/# auth-access = write/auth-access=write/‘ svnserve.conf
[[email protected] conf]# sed -i ‘s/# none-access = read/none-access=none/‘ svnserve.conf
[[email protected] conf]# sed -i ‘s%# passwd-db = passwd%passwd-db = /application/svnpasswd/passwd%‘ svnserve.conf
[[email protected] conf]# sed -i ‘s%# authz-db = authz%authz-db = /application/svnpasswd/authz%‘ svnserve.conf
7.[[email protected] conf]# egrep "\-access|\-db =" svnserve.conf 检查修改后的配置文件
anon-access = read
auth-access = write
password-db = /application/svnpasswd/passwd
authz-db = /application/svnpasswd/authz
[[email protected] conf]#
8.[[email protected] conf]# cp authz passwd /application/svn 复制检查密码文件及密码权限
svndata/ svnpasswd/
[[email protected] conf]# cp authz passwd /application/svnpasswd/
[[email protected] conf]# ll /application/svnpasswd/
total 8
-rw-r--r-- 1 root root 1080 Sep 21 13:16 authz
-rw-r--r-- 1 root root 309 Sep 21 13:16 passwd
[[email protected] conf]# [[email protected] svnpasswd]# chmod 700 * 修改为700的权限
9.[[email protected] svnpasswd]# vi passwd 定义密码
tangbo = 123456
test = 123456
test1 = 123456
[[email protected] svnpasswd]# vim authz 在最后添加如下几项
ett_sa = tangbo,test1
ett_wangguan = test
[sadoc:/]
@ett_sa =rw
@ett_wangguan =r
test = r
10.重启svn
[[email protected] svnpasswd]# pkill svnserve
[[email protected] svnpasswd]# svnserve -d -r /application/svndata/ --pid-file=/application/svndata/
四、客户端安装:
1.下载并安装客户端--windows
本文出自 “山猫” 博客,请务必保留此出处http://cqtangbo.blog.51cto.com/2978612/1752282
以上是关于SVN安装实战的主要内容,如果未能解决你的问题,请参考以下文章