SVN安装和部署
上一篇 / 下一篇 2009-02-27 15:36:45 / 个人分类:测试管理
SVN安装和部署
junqinghuang
1 系统环境
Linux版本:Redhat As 4
5qngok*oG j0SVN版本:
2 安装步骤
2.1 安装apr-1.2.8 .tar.gz
tar xzvf apr-
cd apr-
./configure --prefix=/usr/local/apr-
make
make install
2.2 安装 BerkeleyDB4.0.14
# cd db-
# ../dist/configure
--prefix=/usr/local/db-
# make
# make install
2.3 安装apr-util-1.2.8 .tar.gz
tar xzvf apr-util-
cd apr-util-
./configure
--prefix=/usr/local/apr-util-
make
make install
2.4 安装apache2.2.4
cd httpd-
./configure
--prefix=/usr/local/apache2 --enable-rewrite=shared --with-apr=/usr/local/apr-
make
make install
2.5 安装subversion1.4.3
cd subversion
./configure
--prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs
--with-apr=/usr/local/apr-1.2.8/bin/
make
make install
3 配置
3.1 查看是否/home/apache2/conf/httpd.conf 中是否包括如下模块
LoadModule deflate_module modules/mod_deflate.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule dav_module modules/mod_dav.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
3.2 配置apache2.2.3
编辑/home/apache2/conf/httpd.conf
1,按照以上步骤安装后,http.conf文件中的Documentroot默认为51Testing软件测试网!oD.n:a!Ogl#R
/usr/local/apache2/htdocs51Testing软件测试网KZ5Zi-x
2,修改启动用户,组为apache
User apache
Group apache
3,在最后</VirtualHost> 后添加
<Location
/svn>
DAV svn
SVNParentPath /home/svn/repos
SVNPathAuthz off
AuthType Basic
AuthName "SVN repository"
AuthUserFile /etc/svn.access/users
Require valid-user
</Location>
3.3 启动apache服务
/etc/init.d/httpd stop51Testing软件测试网t {'P Qh\,X*yO
/etc/init.d/httpd start51Testing软件测试网 a,\hP8_ B
/etc/init.d/httpd status
!h9v5[,ZO0/usr/local/apache2/bin/httpd -k stop51Testing软件测试网QWk}8P/G
/usr/local/apache2/bin/httpd -k start
service httpd status
3.4 启动svn服务
杀死系统已经启动的svn服务,启动新的svn服务51Testing软件测试网)X `f+f0m-_`p
cd /usr/local/subversion/bin
b Z&Jee(r?N\0./svnserve --version
'bi_:QkV!^0./svnserve -d -r /home/svn/repos/51Testing软件测试网 fF-s ?fT
3.5 创建svn项目
cd /usr/local/subversion/bin51Testing软件测试网*|f(LN wX
./svnadmin create --fs-type fsfs /home/svn/repos/test
&]vi#[S&r03.6 命令方式向svn目录导入文件
# cd /usr/local/subversion/bin/
%nd1r Q]W0下面这条语句将把路径/home/project1下找到的文件导入到你创建的Subversion仓库中去,提交后的修订版为1。
o(M*Q*oN)k)`0# ./svn import -m "New import" /home/project1/ file:///home/svn/repos/test/
3c}^.\TrA`'SWe03.7 创建访问用户
cd /usr/local/apache2/bin51Testing软件测试网/PNEH0u)c!Y?h
htpasswd –m /etc/svn.access/users hjq51Testing软件测试网 IT4OPi
3.8 用户权限
3.8.1svn客户端提交文档
在svn客户端提交文件时,如果出现权限不够的情况,那么需要修改版本库文件夹的权限,并赋予apache用户51Testing软件测试网] HR4r8HS`
chown 777 /home/svn/repos/test
0hi CE ?+mjRx0chown 777 /home/svn/repos/test/db51Testing软件测试网(W o r[y}#D]V
chown apache:apache -R /home/svn/repos/test51Testing软件测试网_5t'gw!c5tA:c
chown apache:apache -R /home/svn/repos/test/db
{eD*wiR^#v!^-s03.8.2authz
编写authz如下内容
i ?thY0[groups]51Testing软件测试网.gM+a$S;RI7mI
admin = admin, PM
c6W5h1GF&l0programmer = huang
J ~HbIRJ']j0tester = qing51Testing软件测试网yJ0K`#M U
51Testing软件测试网yG)r*@4v9U n
[/]
?]t)M&x"mlq0* = r
1AE8C*|!HM [e;b}0[test:/]51Testing软件测试网)AAHs F0Y
@admin= rw51Testing软件测试网7wf!~E2O'GW
@ programmer=r51Testing软件测试网`6`*l@ ]cj1|fd
@tester=r51Testing软件测试网+dn8m9Ws
[test:/code]
nI!l ]|}0@ programmer=rw
VO5hMX2Q0p*A&R0@tester=r
K|/z]1a9A4t1sfV0[test:/testfilds]51Testing软件测试网)F u/Z q,c@;C,P
@ programmer=r
L.[6A`6Ju0@tester=rw
Jyq7V-a5G0Location中增加AuthzSVNAccessFile /etc/svn.access/authz51Testing软件测试网 O@x1JPM)E3e-}a E
具体权限分配见http://bbs.iusesvn.com/thread-6-1-1.html51Testing软件测试网Q-awKe?q3n:l
3.9 IE访问
q2[#J!C!Ln0SVN checkout路径http://10.10.70.78/svn/test/
&K2O]q:U03.10 关于301错误
曾在svn安装中,发现出现过301错误,经持续排查,发现是由于httpd.conf文件中的<Location /svn>被配置成<Location /svn/repos>,修改后访问正常。
PEU#G.gy03.11 Virtual host方式
通过virtual host方式实现而非用location方式实现
LY PSex I0RD4t01,配置apache
# Virtual
hosts
Include
conf/extra/httpd-vhosts.conf
2,编辑/usr/loacal//apache2/conf/extra/httpd-vhost.conf
<VirtualHost
*:80>
ServerAdmin huangjq@ufida.com.cn
DocumentRoot /usr/local/apache2/htdocs
ServerName test.hjq.com
ServerAlias test.hjq.com
ErrorLog logs/svn_error_log
CustomLog logs/svn.com-access_log common
<Location
/svn>
DAV svn
SVNParentPath /home/svn/repos
SVNPathAuthz off
AuthType Basic
AuthName "SVN
repository"
AuthUserFile /etc/svn.access/users
Require valid-user
</Location>
</VirtualHost>
3,其他步骤同上
4,IE访问http://test.hjq.com/svn/test
I_\#}u6N$JN$eQB051Testing软件测试网JXH Q UeX/O
{
建立一个文本文件,取名为kill-svn-folders.reg(扩展名由txt改为reg),内容如下:
@ o'}3F7Kz0Windows Registry Editor Version 5.0051Testing软件测试网o"un1AQck
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
1P#O7m$\5GS0@="Delete SVN Folders"
0Re j IJ,}7}0[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
-TxLnSC!A5V[0@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""51Testing软件测试网k3nhT1V
本文原创,是我的学习与实践笔记,如果转载,请注明出处,谢谢!51Testing软件测试网7[U;q5w2lEsh.Ao
TAG:
标题搜索
日历
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
1 | 2 | 3 | 4 | 5 | 6 | ||||
7 | 8 | 9 | 10 | 11 | 12 | 13 | |||
14 | 15 | 16 | 17 | 18 | 19 | 20 | |||
21 | 22 | 23 | 24 | 25 | 26 | 27 | |||
28 | 29 | 30 |
我的存档
数据统计
- 访问量: 94042
- 日志数: 83
- 文件数: 2
- 书签数: 2
- 建立时间: 2008-01-29
- 更新时间: 2013-06-29