测试管理,自动化测试、手机客户端测试、wap站点测试研究

SVN安装和部署

上一篇 / 下一篇  2009-02-27 15:36:45 / 个人分类:测试管理

SVN安装和部署

&\k4NYM P0

junqinghuang 2009-2-23

[0l K X t0

1      系统环境

Linux版本:Redhat As 4

5qngok*oG j0

SVN版本:1.4.3

A%b3bN\ MV0q7|L0

2      安装步骤

2.1   安装apr-1.2.8.tar.gz  

   tar xzvf apr-1.2.8.tar.gz 51Testing软件测试网R:i$xd5L7i

   cd apr-1.2.8 51Testing软件测试网k0IV#y^h/h}

   ./configure --prefix=/usr/local/apr-1.2.8 51Testing软件测试网 s!R-Ml~*D

   make 51Testing软件测试网?"xg@+O H*W \*i

   make install 51Testing软件测试网fic {5D Ybw

 

T6K"\M!U;]$r0

2.2   安装 BerkeleyDB4.0.14

 

r `CQh2X[j0

# cd db-4.0.14/build_unix51Testing软件测试网2j F(y*G(r

# ../dist/configure --prefix=/usr/local/db-4.0.14--enable-compat185

vggZ}0

# make

x7\`6Yk"D1W N.qCs0

# make install51Testing软件测试网7Q5~&Q/w^)q#W

 51Testing软件测试网s:TU Ur Ki

2.3   安装apr-util-1.2.8.tar.gz 

   tar xzvf apr-util-1.2.8.tar.gz 51Testing软件测试网"l1wj#w Rq L2M

   cd apr-util-1.2.8 51Testing软件测试网 K\*G!q-\ a

   ./configure --prefix=/usr/local/apr-util-1.2.8--with-apr=/usr/local/apr-1.2.8 --with-berkeley-db=/usr/local/db-4.0.14/

M"k9M,`.U)Y5`)`0

   make 51Testing软件测试网1Oig%l(n%Pv

   make install 

d j)Y@X:s(u0

2.4   安装apache2.2.4

   cd httpd-2.2.451Testing软件测试网T%`^lB

 

&CDit+q0

  ./configure --prefix=/usr/local/apache2 --enable-rewrite=shared --with-apr=/usr/local/apr-1.2.8/bin/apr-1-config --with-apr-util=/usr/local/apr-util-1.2.8/bin/apu-1-config --enable-dav=shared --enable-ssl=shared --enable-deflate=shared --enable-so --enable-maintainer-mode51Testing软件测试网7S0{#D?Dj

 51Testing软件测试网K4?:}v TW6Ct

make 

/|!Qk{K'd-|R0

make install 

9{8V&C,}([l?1O-L.{0

 51Testing软件测试网NA_X)E }+{sr}6j

2.5   安装subversion1.4.3

cd subversion1.4.3

^@rb8m4v Iv5U0

 

~-E*R;]EF~#Y0

./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr-1.2.8/bin/apr-1-config --with-apr-util=/usr/local/apr-util-1.2.8/bin/apu-1-config --with-ssl --enable-maintainer --with-berkeley-db=/usr/local/db-4.0.14/ 

(PJ(}U2U,s]S0

 

(LKV g_(IjW|-R5x0

make 

@v3k#Y!_0t0

make install 51Testing软件测试网5H^5g"QYPF+iS6S

3      配置

3.1   查看是否/home/apache2/conf/httpd.conf 中是否包括如下模块

LoadModule deflate_module modules/mod_deflate.so 51Testing软件测试网9X$? BE!{

LoadModule ssl_module modules/mod_ssl.so 

`1_'V7g9E0

LoadModule dav_module modules/mod_dav.so 51Testing软件测试网q*hBHQ#D!Urh

LoadModule rewrite_module modules/mod_rewrite.so 

5_| D6@6y!`0

LoadModule dav_svn_module    modules/mod_dav_svn.so 

0U*C1ic(i'y v0c0

LoadModule authz_svn_module  modules/mod_authz_svn.so 51Testing软件测试网(w$]KF9w

3.2   配置apache2.2.3 

编辑/home/apache2/conf/httpd.conf 51Testing软件测试网$c2oB[ L'^ F

 51Testing软件测试网 y"uGp mOkV

1,按照以上步骤安装后,http.conf文件中的Documentroot默认为51Testing软件测试网!oD.n:a!Ogl#R

/usr/local/apache2/htdocs51Testing软件测试网K Z5Zi-x

2,修改启动用户,组为apache 51Testing软件测试网3s2R^O LYPrcM1o

User apache51Testing软件测试网7t7A]YlNQ2_

Group apache

;T9ZMU hi] kE0

3,在最后</VirtualHost> 后添加 51Testing软件测试网 T1{k_W]!PeZ1P}

 <Location /svn>

i{%WU(Y'J0

      DAV svn

S\ wqT}0

      SVNParentPath /home/svn/repos

$~~b1l$X&sP#{ bC0

      SVNPathAuthz off51Testing软件测试网b$U\_-J:o@!^#B"~

      AuthType Basic

H9|.BzG0

      AuthName "SVN repository"

+\}P cH1BY3_1Wb^0

      AuthUserFile /etc/svn.access/users51Testing软件测试网B4b-_!QlCY8S D

      Require valid-user

Z%l?u }%O q0

</Location>51Testing软件测试网 S,L}3f;m?

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软件测试网Q Wk}8P/G

/usr/local/apache2/bin/httpd -k start51Testing软件测试网PS!\t)AQ)O

service httpd status

u s6Wd6mu_6Bj*J0

3.4   启动svn服务

杀死系统已经启动的svn服务,启动新的svn服务51Testing软件测试网)X`f+f0m-_`p

cd /usr/local/subversion/bin

b Z&Jee(r?N\0

./svnserve --version

'b i_: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&r0

3.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`'SWe0

3.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?+mjRx0

chown 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!^-s0

3.8.2authz

编写authz如下内容

i ?t hY0

[groups]51Testing软件测试网.gM+a$S;RI7mI

admin = admin, PM

c6W5h1GF&l0

programmer = huang

J ~HbIRJ']j0

tester = 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软件测试网7w f!~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/Zq,c@;C,P

@ programmer=r

L.[6A `6Ju0

@tester=rw

Jyq7V-a5G0

 

t3hB-z,i2X\(wK6E.x0

Location中增加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访问

http://10.10.70.78/svn/test/

q2[#J!C!Ln0

SVN checkout路径http://10.10.70.78/svn/test/

&K2O]q:U0

3.10      关于301错误

曾在svn安装中,发现出现过301错误,经持续排查,发现是由于httpd.conf文件中的<Location /svn>被配置成<Location /svn/repos>,修改后访问正常。

PEU#G.gy0

3.11      Virtual host方式

通过virtual host方式实现而非用location方式实现

LY P Sex I0RD4t0

1,配置apache2.2.3编辑/home/apache2/conf/httpd.conf ,去掉虚拟主机virtual hosts注释,如下:51Testing软件测试网6x4}[}3B3UDM?v

# Virtual hosts 51Testing软件测试网I7_+M$^-h,VP

Include conf/extra/httpd-vhosts.conf 

2kM,?n%u+]do0

2,编辑/usr/loacal//apache2/conf/extra/httpd-vhost.conf51Testing软件测试网 ?9pt[S5h\z

<VirtualHost *:80>

'l$s R@nN9r8t(c0

   ServerAdmin huangjq@ufida.com.cn

FO7@l] `0

   DocumentRoot /usr/local/apache2/htdocs51Testing软件测试网*TeLX+sS0z

   ServerName test.hjq.com

mpN`\0

   ServerAlias test.hjq.com

;P7T1D,]3rj_0

   ErrorLog logs/svn_error_log

1Bc4{{/U8?)Oq8BR*P0

   CustomLog logs/svn.com-access_log common

&q;{9g~~ Q~,u0

     <Location /svn>

']g4i:XH0

             DAV svn51Testing软件测试网9@3p|f3ZJ2S

             SVNParentPath /home/svn/repos

&M.P0ODSB!a/j-y0

             SVNPathAuthz off

z$i f n/D9F-Vc\T0

             AuthType Basic

&@#i'nG9t0Z*P0

             AuthName "SVN repository"51Testing软件测试网k$W+bE0ucJ |

             AuthUserFile /etc/svn.access/users

(U]wTS%Ns R(V0

             Require valid-user51Testing软件测试网4k1T\W0AZS$\

      </Location>

4{ nNY)Ou0c!RR0

</VirtualHost>

J PrR~ ry#z(uF0

3其他步骤同上51Testing软件测试网2q _@*{B)h)?

4IE访问http://test.hjq.com/svn/test51Testing软件测试网2kn%s$^ Zd3pj6H


I_ \#}u6N$JN$eQB051Testing软件测试网JXH Q UeX/O {

附加:删除.svn文件的方法51Testing软件测试网~$Sl1W ?/y%]

建立一个文本文件,取名为kill-svn-folders.reg(扩展名由txt改为reg),内容如下:

@ o'}3F7Kz0

Windows Registry Editor Version 5.0051Testing软件测试网o"un1AQck

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN] 

1P#O7m$\5GS0

@="Delete SVN Folders"

0Rej IJ,}7}0

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command] 

-TxLnS C!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

保存之后,双击这个reg文件。成功后,在每一个文件夹上点击右键都会有一个“Delete SVN Folders”的选项,点击之后,既可以删除这个文件下下面所有的.svn文件了 

e8\'MbQ$dcQ0

本文原创,是我的学习与实践笔记,如果转载,请注明出处,谢谢!51Testing软件测试网7[U;q5w2lEsh.A o


TAG:

 

评分:0

我来说两句

Open Toolbar