安装apache服务器
[[email protected] ~]# yum install httpd -y
[[email protected] ~]# httpd -version
Server version: Apache/2.4.6 (CentOS)
Server built: Apr 12 2017 21:03:28
安装svn
[[email protected] ~]# yum install mod_dav_svn subversion -y
[[email protected] ~]# svnserve –version
svnserve, version 1.7.14 (r1542130)
compiled Nov 20 2015, 19:25:09
Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository back-end (FS) modules are available:
fs_base : Module for working with a Berkeley DB repository.
fs_fs : Module for working with a plain file (FSFS) repository.
Cyrus SASL authentication is available.
[[email protected] ~]# ls /etc/httpd/modules/ | grep svn
mod_authz_svn.so
mod_dav_svn.so
apache下配置svn
[[email protected] ~]# vi /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
DAV svn
SVNParentPath /var/www/svn #svn的根目录SSLRequireSSL #SSL访问权限
AuthType Basic #Basic认证方式
AuthName "Authorization SVN" #认证时显示的信息
AuthUserFile /var/www/svn/passwd #用户文件&密码
AuthzSVNAccessFile /var/www/svn/authz #访问权限控制文件
Require valid-user #要求真实用户,不能匿名
创建仓库
[[email protected] ~]# mkdir /var/www/svn
[[email protected] ~]# svnadmin create /var/www/svn/testrep
[[email protected] ~]# ls /var/www/svn/testrep/
conf db format hooks locks README.txt
创建权限文件
[[email protected] ~]# touch /var/www/svn/passwd
[[email protected] ~]# touch /var/www/svn/authz
安装PHP,iF.SVNAdmin使用php写的,因此我们需要安装php
[[email protected] ~]# yum install php -y
下载svnadmin
[[email protected] ~]# cd /usr/local/src
[[email protected] src]# wget https://nchc.dl.sourceforge.net/project/ifsvnadmin/svnadmin-1.6.2.zip
解压、移动
[[email protected] src]# unzip svnadmin-1.6.2.zip
[[email protected] src]# cp -r iF.SVNAdmin-stable-1.6.2/ /var/www/html/svnadmin
进入目录,修改data权限
[[email protected] html]# cd /var/www/html/svnadmin
[[email protected] html]# chmod -R 777 data
修改服务
[[email protected] ~]# vim /etc/sysconfig/svnserve
OPTIONS=”-r /var/svn”
======> OPTIONS=”-r /var/www/svn”
apache服务命令 启动: systemctl start httpd.service 开机自启动:systemctl enable httpd.service 重启: systemctl restart httpd.service