一般直接用yum安装就可以了,在装好系统后都会安装开发工具
即
yum groupinstall "Development tools"
如果没有就去仓库搜索下
yum search subversion
这些都比较简单,下面来看怎么配置subversion
首相创建一个svn的仓库目录
mkdir /usr/local/repositories
在目录下创建subversion的版本库,名称为stategracecms
cd /usr/local/repositories
svnadmin create stategracecms
上面我创建了一个stategracecms的版本库
当然这里可以创建多个版本库,名字不同,比如我在创建一个svn名字的版本库
svnadmin create svn
在目录usr/local/repositories下面会出现stategracecms和svn两个文件夹
启动subversion服务
svnserve -d -r /usr/local/repositories
这里如果要改变默认3690的端口号在后米娜可以在加参数--listen-port 3690,即
svnserve -d -r /usr/local/repositories --listen-port 3691
测试下是否可以检出
cd /tmp
svn co svn://161.2.1.108/stategracecms
验证了可以检出
下面设置下认证配置,默认匿名用户只有检出更新的权限,没有提交写入的权限,而我们平时要设置为,只有认证用户才有检出和写入权限,而匿名无权限
cd /usr/local/repositories/stategracecms/conf/
这里面有三个文件
authz,passwd,svnserve.conf
一般改两个就行了,passwd不用说也知道,肯定是用户的了,第二个就是认证的了,
vi svnserve.conf
# anon-access = read
# auth-access = write
# password-db = passwd
这三个修改,并去掉注释
anon-access = none
auth-access = write
password-db = passwd
添加用户
vi passwd
打开后直接按照示例添加即可,如
# harry = harryssecret
# sally = sallyssecret
stategrace = 123456
下面我们就来添加下自启动
vi /etc/rc.local
在最下面添加启动命令即可,即
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
svnserve -d -r /usr/local/repositories
如果我们想停止svn就可以使用如下命令
ps -aux|grep svnserve
kill -9 进程id
最后我们改变下防火墙规则
vi /etc/sysconfig/iptables
#这里是打开防火墙设置,在22端口的下面一行添加下面这行代码,如果要开启8080端口只需要把80改成8080既可
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
#重启防火墙
service iptables restart
或者选择关闭
service iptables stop