下载SVN、依赖包以及apache安装文件

wget http://subversion.tigris.org/downloads/subversion-1.6.15.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.15.tar.bz2
wget http://labs.renren.com/apache-mirror//httpd/httpd-2.2.17.tar.gz

安装apr、apr-util

tar xjvf subversion-deps-1.6.15.tar.bz2
cd subversion-1.6.15/apr
./configure
make
sudo make install
cd ../apr-util/
./configure
make
sudo make install

安装apache

tar zxvf httpd-2.2.17.tar.gz
cd httpd-2.2.17
./configure --enable-dav --enable-so --enable-maintainer-mode --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config
make
sudo make install

安装subversion

tar xjvf subversion-1.6.15.tar.bz2
cd subversion-1.6.15
./configure --with-apxs=/usr/local/apache2/bin/apxs --without-serf
make
sudo make install
查看httpd.conf确认svn是否安装成功
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

配置apache

配置apache,添加SVN配置
###更改apache默认启动用户为hrj
User hrj
Group users
###注释掉拒绝用户访问代码
#<Directory />
# Options FollowSymLinks
# AllowOverride None
# Order deny,allow
# Deny from all
#</Directory>
### 添加SVN配置
<VirtualHost *>
ServerName phx3
DocumentRoot /home/y/share/htdocs/
<Location /repos>
DAV svn
SVNParentPath /disk/repos
Allow from All
AuthType Basic
AuthName "subversion repository"
AuthUserFile /disk/repos/passwd
AuthzSVNAccessFile /disk/repos/access
# Satisfy All
Require valid-user
</Location>
</VirtualHost>

创建SVN

###创建SVN目录
sudo mkdir -p /disk/repos/SDS
sudo chown -R hrj /disk/repos
svnadmin create --fs-type fsfs /disk/repos/SDS/
###如果有备份的SVN文件,将备份文件导入svn
svnadmin load /disk/repos/SDS < repos.backup

配置用户权限

###创建帐号密码文件 帐号:rujian.hu,密码:xxx
/usr/local/apache2/bin/htpasswd -c /disk/repos/passwd rujian.hu xxx
###添加帐号
/usr/local/apache2/bin/htpasswd -b /disk/repos/passwd xxx xxx
###配置用户访问权限
vim /disk/repos/access

[groups]
SDS_ROOT=rujian.hu
SDS_USER = xxx
[/]
* =
@SDS_ROOT = rw

[SDS:/dd]
@SDS_USER = rw

启动apache

/usr/local/apache2/bin/httpd -k start