Wget
|
http://www.eu.apache.org/dist/httpd/httpd-2.2.14.tar.gz
|
Wget
|
http://subversion.tigris.org/downloads/subversion-1.6.9.tar.bz2
|
Wget
|
http://subversion.tigris.org/downloads/subversion-deps-1.6.9.tar.bz2
|
Tar zxvf httpd-2.2.14.tar.gz
Tar xjvf subversion-1.6.9.tar.bz2
Tar xjvf subversion-deps-1.6.9.tar.bz2
#deps
会解压到
sub
version
目录,在
subversion
目录中会多出一些文件
Cd httpd-2.2.14
./configure --enable-dav --enable-so --prefix=/usr/local/www
Make
Make install
Cd subve
rsion-1.6.9
./configure --with-apxs=/usr/local/www/bin/apxs --prefix=/usr/local/svn
Make
Make install
#Apache
与
Svn
相结合
Vim
/usr/local/www/conf/httpd.conf
#
修改监听端口,增加以下内容
<Location /svn>
DAV svn
SVNPath /svndata/ch_project1
AuthType Basic
AuthName "ch_gc Repository"
AuthUserFile /svndata/httpasswd
Require valiad-user
</Location>
#
设定
http
方式访问的密码:
htpasswd -cm /svndata/httpasswd svnadmin
#
启动
Vim
/etc/rc.d/rc.local
/usr/local/www/bin/apachectl start
/usr/local/svn/bin/svnserve -d -r /svndata
#
创建配置数据仓库:
svnadmin create /svndata/project1
Vim /svndata/project1/conf/
svnserve.conf
为了统一管理用户名密码,均指定到一个目录
authz-db = /svndata/authz
password-db = /svndata/passwd
#
钩子程序自动检出
vim /svndata/ch_project1/hooks/post-commit
#
增加以下代码
export LC_CTYPE=en_US.UTF-8
svn update --username lgq2 --password 123456 svn://127.0.0.1/ch_project1 /home/svnweb
chmod 755 -R /home/svnweb/