svn的安装配置apache模式

1 http://apr.apache.org/download.cgi
有旧低版本的,建议先强制删除掉
wget http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.6.tar.gz
./configure --prefix=$HOME/apr
make
make install

wget http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.4.1.tar.gz
./configure --with-apr=$HOME/apr --prefix=$HOME/apr-utl
make
make install

2 http://httpd.apache.org/download.cgi
wget http://www.fayea.com/apache-mirror//httpd/httpd-2.2.22.tar.gz
./configure --enable-dav --enable-dav-fs --prefix=$HOME/httpd
make
make install

3 http://www.sqlite.org/download.html.
wget http://www.sqlite.org/sqlite-autoconf-3071300.tar.gz
./configure --prefix=$HOME/sqlite
有旧低版本的sqlite建议先强制删除掉

4 http://www.webdav.org/neon/
wget http://www.webdav.org/neon/neon-0.29.6.tar.gz
tar zxf neon/neon-0.29.6.tar.gz -C neon
./configure --prefix=$HOME/neon



5. download svn server
wget http://labs.renren.com/apache-mirror/subversion/subversion-1.7.5.tar.gz
tar zxf subversion/subversion-1.7.5.tar.gz


./configure --with-apxs=$HOME/httpd/bin/apxs \
--with-sqlite=$HOME/sqlite \
--with-apr=$HOME/apr \
--with-apr-util=$HOME/apr-utl \
--with-neon=$HOME/neon \
--with-ssl \
--without-berkeley-db \
--prefix=$HOME/svn


make
make install

6 验证各个模块
确认需要的apache模块产生了
find $HOME/httpd -name mod_dav_svn.so
find $HOME/httpd -name mod_authz_svn.so

确认svn客户端的模块都有了
svn --version
确认有ra_neon, ra_svn ,ra_local 三��modules


7 初始化repository
mkdir -p $HOME/data/
svnadmin create $HOME/data/
svn import httpd/conf file://$HOME/data -m "New repository test"
svn list file://$HOME/data

8 安装各个依赖软件的共享库
echo "$HOME/sqlite/lib" >> SVN.conf
echo "$HOME/apr/lib" >> SVN.conf
echo "$HOME/apr-lib/lib" >> SVN.conf
echo "$HOME/httpd/lib" >> SVN.conf
echo "$HOME/svn/lib" >> SVN.conf

sudo cat SVN.conf > /etc/ld.so.conf.d/SVN.conf
sudo ldconfig


9 配置
编辑httpd.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

确认模块能正确装载
$HOME/httpd/bin/httpd -M

建立用户文件
htpasswd -bcm svn/svn-auth-file svn password123
htpasswd -bm svn/svn-auth-file svnadmin password123

再次编辑httpd.conf
<Location /svn>
DAV svn 这个URL由DAV模块处理
SVNPath /home/svn/data
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /home/svn/svn/svn-auth-file
Require valid-user
AuthzSVNAccessFile /home/svn/svn/svn-access-file
</Location>

权限控制文件
cat /home/svn/svn/svn-access-file

[groups]
admin = svnadmin, svn
team1 = svn
team2 = svnadmin
[/]
* = r
@admin = rw
[proj1:/]
@team1 = rw
[proj2:/]
@team2 = rw


10 测试
apachectl restart
svn list http://ndb1.test:8080/svn

在浏览器器上看

http://ndb1.test:8080/svn

一种不用编译的安装方法

系统自带的安装方法


你可能感兴趣的:(SVN)