1,Install Apache,APR and APR-util(http://apr.apache.org/)
#tar -zxf apr-1.3.3.tar.gz
#cd apr-1.3.3
#./configure
#make
#make install
#tar -zxf apr-util-1.3.4.tar.gz
#cd apr-util-1.3.4
#./configure –with-apr=/usr/local/apr/
#make
#make install
编译apache,加如下参数
–enable-dav –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/apr/bin/apu-1-config
2. Install Neon(http://www.webdav.org/neon/)
neon is an HTTP and WebDAV client library, with a C interface.
#tar -zxf neon-0.28.3.tar.gz
#cd neon-0.28.3
#./configure –prefix=/usr/local/neon
#make
#make install
3. Install Subversion (http://subversion.tigris.org/)
#tar -zxf subversion-1.5.2.tar.gz
#cd subversion-1.5.2
#./configure –prefix=/usr/local/subversion –with-apxs=/usr/local/apache2/bin/apxs –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr –with-neon=/usr/local/neon
#make
#make install
编译过程中,发生如下错误
/usr/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
确认libexpat已经被载入
# ldconfig -p|grep expat
libexpat.so.0 (libc6) => /usr/lib/libexpat.so.0
做个链接,并重载libs,最后检查一下
#cd /usr/lib
#ln -s libexpat.so.0.5.0 libexpat.so
#ldconfig
#ldconfig -p|grep expat
libexpat.so.0 (libc6) => /usr/lib/libexpat.so.0
libexpat.so (libc6) => /usr/lib/libexpat.so
继续编译,通过,OY
4. 配置
打开apache的httpd.conf文件,查找下面两行内容,如果存在,则表示subversion已经安装成功
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
建立代码仓库及配置文件
#cd /usr/local/subversion/
#mkdir repos
#mkdir www
#touch auth
#cd repos
#svnadmin create myproject
通过apache的htpasswd工具创建用户,并按提示输入密码
#cd ..
#/usr/local/apache2/bin/htpasswd -c /usr/local/subversion/passwd kevin
编辑auth文件,写入以下内容,赋予此用户对于myproject的读写权限(例子很简单,更复杂的权限配置,请自己去查官方文档或google搜索“SVN权限”)
[/]
* = rw[/svn]
* = rw[/svn/myproject]
lirui=rw
配置apache,设置svn的工作目录
<Location /svn>
DAV svn
SVNParentPath /usr/local/subversion/repos
AuthType Basic
AuthName “Subversion repository”
AuthUserFile /usr/local/subversion/passwd
AuthzSVNAccessFile /usr/local/subversion/auth
Require valid-user
</Location>
重启apache