1.安装svn服务器端
yum install subversion
2.创建一个svn版本仓库,赋权,创建一个SVN版本仓库
mkdir -p /svn/repos
chmod -R 777 repos
svnadmin create /var/svn/repos/test
3.修改conf下的配置文件
cd /var/svn/repos/test/conf && ll
(1)
//配置版本库信息和用户文件和用户密码文件的路径、版本库路径
vim svnserve.conf
//把前面的#号和空格去掉
# anon-access = read
# auth-access = write
# password-db = passwd
//修改svn版本库
realm = test
(2)
//创建svn组和组用户的权限
vim authz
[groups]
//创建一个test的组,和用户user1,user2
test= user1,user2
//制定根目录下的权限
[/]
//test组用户权限为读写
@test= rw
//其他用户只有读权限
* = r
(3)
//创建用户密码
vim passwd
[users]
user1= password1
user2= password2
4.可以设置自启动
启动svn服务
svnserve -d -r /var/svn/repos/test
将其加入自启动
vim /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 /var/svn/repos/test
最后;过程中遇到的问题:无法连接到svn
svn: E200002: line 19: Option expected
原因是:配置文件中不允许出现空格!!!!!
开放远程可用,在esc控制台中添加一个入口规则。