svn服务器安装

mkdir -p /archive/download
mkdir -p /opt/compile

yum install apr apr-devel apr-util apr-util-devel gcc openssl openssl-devel


cd /opt/compile
tar xvfz /archive/download/httpd-2.2.21.tar.gz
cd httpd-2.2.21
LDFLAGS=”-L/lib64 -L/usr/lib64″ ./configure –prefix=/opt/apache2 –with-mpm=worker –enable-static-support –enable-module=rewrite -enable-dav -enable-so
#-enable-maintainer-mode
make
make install
cp /opt/apache2/bin/apachectl /sbin


tar xvfz /archive/download/subversion-1.7.9.tar.gz
cd subversion-1.7.9
yum install unzip
./get-deps.sh
./configure –prefix=/opt/subversion –with-apxs=/opt/apache2/bin/apxs –with-ssl –with-zlib=/usr/local/zlib
make
make install


vi httpd.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /opt/svnroot/repository
AuthzSVNAccessFile /opt/svnroot/repository/authgroup
AuthType Basic
AuthName “Subversion Repository”
AuthUserFile /opt/svnroot/repository/authpass
Require valid-user
</Location>

mkdir -p /opt/svnroot/repository

svnserve -d -r /opt/svnroot

创建密钥文件、初始帐号
htpasswd  -c /opt/svnroot/repository/authpass yan
New password:

新增帐号
htpasswd  -b /opt/svnroot/repository/authpass newuser newpasswd

设置权限
vi /opt/svnroot/repository/authgroup
[groups]
admin=yan
test=tan

[/]
@admin = rw

[test:/]
@test = rw

—-

创建新的 project newApp
svnadmin create /opt/svnroot/repository/newApp


客户端
svn checkout http://192.168.1.x/svn/newApp

进入 newApp 目录,新建目录:
trunk
branches
tags
svn add/commit 准备好基础结构。

重新checkout
svn checkout http://192.168.1.x/svn/newApp/trunk
即可进入正常开发,以后根据需要为trunk目录增加branch、tag。

 

注:如果遇到以下问题

/usr/local/lib/libsvn_subr-1.so.0: undefined symbol: apr_hash_clear

这是因为httpd和subversion编译使用的apr和apr-util使用的库不相同造成的。

可以在编译httpd时指定–with-par 和 –withd-par-util参数来指定使用subversion相同的apr和apr-util来编译httpd.

LDFLAGS=”-L/lib64 -L/usr/lib64″ ./configure –prefix=/opt/apache2 –with-mpm=worker –enable-static-support –enable-module=rewrite -enable-dav -enable-so –with-apr=/opt/compile/subversion-1.7.9/apr –with-apr-util=/opt/compile/subversion-1.7.9/apr-util

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>