一般功能性的插件 用yum安装最方便快捷的方法,最好不去编译,因为编译很麻烦
系统环境:redhat6.5
[root@localhost sadoc]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@localhost sadoc]# uname -rm
2.6.32-431.el6.x86_64 x86_64
yum安装rpm包安装后本地不清除的方法
[root@localhost ~]# yum -y install subversion
[root@localhost ~]# sed -i 's#keepcache=0#keepcache=1#g' /etc/yum.conf
[root@localhost ~]# grep keepcache /etc/yum.conf
keepcache=1
[root@localhost ~]# mkdir -p /application/svndata 数据存储根目录
[root@localhost ~]# mkdir -p /application/svnpasswd 用户密码的权限目录
[root@localhost ~]# svnserve -d -r /application/svndata/
解释一下:-d [--deamon] 守护进程模式
-r [--root] 指定数据存储根目录
--listen-port ARG 指定监听某一个IP
--pid-file arg 指定进程号
[root@localhost ~]# ps -ef | grep svn 确认服务是否启动svn的三种方法
root 1808 1 0 22:57 ? 00:00:00 svnserve -d -r /application/svndata/
root 1810 1710 0 22:57 pts/0 00:00:00 grep svn
[root@localhost ~]# lsof -i:3690
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
svnserve 1808 root 3u IPv4 13395 0t0 TCP *:svn (LISTEN)
[root@localhost ~]# netstat -lntup | grep 3690
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 1808/svnserve
[root@localhost ~]# svnadmin create /application/svndata/sadoc 创建svn版本库sadoc
[root@localhost ~]# cd /application/svndata/sadoc/conf/
[root@localhost conf]# ls
authz passwd svnserve.conf
[root@localhost conf]#cp authz passwd /application/svnpasswd/
[root@localhost conf]#cp svnserve.conf svnserve.conf.bak 备份配置文件
[root@localhost conf]#vim svnserve.conf 找到以下几行取消注释并修改
anon-access = none
auth-access = write
authz-db = /application/svnpasswd/authz
password-db = /application/svnpasswd/passwd 密码集中管理
realm = /application/svndata/sadoc # 认证空间名,版本库所在目录
[root@localhost conf]# diff svnserve.conf svnserve.conf.bak
diff: extra operand `svnserve.conf.bak'
diff: Try `diff --help' for more information.
[root@localhost conf]# diff svnserve.conf svnserve.conf.bak
12,13c12,13
< anon-access = none
< auth-access = write
---
> # anon-access = read
> # auth-access = write
20c20
< password-db = /application/svnpasswd/passwd
---
> # password-db = passwd
27c27
< authz-db = /application/svnpasswd/authz
---
> # authz-db = authz
vi passwd
在[users]块中添加用户和密码,格式:帐号=密码,
[users]
# harry = harryssecret
# sally = sallyssecret
zzzzz = uuu2017
vi authz 在文件末尾添加一下内容
[/]
zhoujinlong = rw
[root@localhost ~]#pkill svnserve
[root@localhost ~]#svnserve -d -r /application/svndata
更改svnserve.conf时重启svn才会生效
编辑authz和passwd不需要重启svn
在win安装客户端,下载安装下一步下一步即可
在桌面上右击鼠标
红色框出部分按照
启动svn过程中发生的报错:
[root@localhost svndata]# svnserve -d -r /application/svndata/
svnserve: E000098: Can't bind server socket: Address already in use
解决办法:
[root@localhost svndata]# pkill svn
[root@localhost svndata]# svnserve -d -r /application/svndata/ --listen-port 3691
[root@localhost svndata]# ps -ef | grep svn
root 1285 1 0 20:50 ? 00:00:00 svnserve -d -r /application/svndata/
root 1288 1 0 20:51 ? 00:00:00 svnserve -d -r /application/svndata/ --listen-port 3691
这样就可以了