一、 下载依赖包
1. apr源码包
http:
//mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.5.2.tar.gz
2. apr-util源码包
http:
//mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
3. serf源码包
https:
//www.apache.org/dist/serf/serf-1.3.9.tar.bz2
4. scons源码包
https:
//sourceforge.net/projects/scons/files/scons/2.5.1/
5. sqlite-amalgamation源码包
http:
//www.sqlite.org/2017/sqlite-amalgamation-3160200.zip
6. svn源码包
http:
//mirrors.cnnic.cn/apache/subversion/subversion-1.9.9.tar.gz
二、安装依赖包
apr
> tar xf apr-1.5.2.tar.gz
> cd apr-1.5.2
> ./configure --prefix=/usr/local/apr
> make && make install
apr-util
> tar xf apr-util-1.5.4.tar.gz
> cd apr-util-1.5.4
> ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
> make && make install
scons
> tar xf scons-2.5.1.tar.gz
> cd scons-2.5.1
> python setup.py install --prefix=/usr/local/scons
serf
> tar xf serf-1.3.9.tar.bz2
> cd serf-1.3.9
> /usr/local/scons/bin/scons PREFIX=/usr/local/serf APR=/usr/local/apr APU=/usr/local/apr-util
> /usr/local/scons/bin/scons install
> cp /data/serf/lib/libserf-1.so* /usr/local/lib/
svn
> tar xf subversion-1.9.5.tar.gz
> mkdir /usr/local/subversion-1.9.5/sqlite-amalgamation
> unzip sqlite-amalgamation-3160200.zip -d /data/subversion-1.9.5/
> cd subversion-1.9.5
> mv sqlite-amalgamation-3160200 sqlite-amalgamation
> ./configure --prefix=/usr/local/subversion \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-serf=/usr/local/serf \
--enable-mod-activation
> make && make install
三、配置svnserve
1. 查看版本
svnserve --version
2. 创建仓库
svnadmin create /data/svndata/
3. 配置权限,用户和密码等信息
svnserve.conf
[general]
#禁止匿名访问
anon-access = none
#授权用户写权限
auth-access = write
#用户密码文件
password-db = passwd
#授权登录文件
authz-db = authz
#每个svn项目认证名,建议写项目名
realm = repos
authz(权限配置,重点说一哈)
[groups]
backend_dev = zhangsan
frontend-dev = lisi
test = test01
[/]
admin = rw #权限能按目录来继承,admin有根目录下所有权限
[fxhk:/admin]
@backend_dev=rw #这个组有权限读写,其他用户无权限;
[fxhk:/web] #项目的目录就在fxhk这级目录,对下一级目录的权限控制可以这么写
@frontend-dev=rw
四、启动脚本
svnserve -d -r /data/svndata/ --listen-port 3690 --log-file=/var/log/svnserve.log