锘??xml version="1.0" encoding="utf-8" standalone="yes"?>一本久久综合亚洲鲁鲁五月天,亚洲av极品无码专区在线观看,亚洲愉拍一区二区三区http://www.tkk7.com/RR00/category/2878.html涓嶈鍩嬪ご鑻﹀共錛岃瀛︿範錛屽涔狅紝鍐嶅涔犮傘傘傘傘? <br> powered by <font color='orange'>R.Zeus</font>zh-cnTue, 27 Feb 2007 10:37:47 GMTTue, 27 Feb 2007 10:37:47 GMT60寤虹珛涓涓畨鍏ㄧ殑Subversion鏈嶅姟鍣?/title><link>http://www.tkk7.com/RR00/articles/10619.html</link><dc:creator>R.Zeus</dc:creator><author>R.Zeus</author><pubDate>Sun, 21 Aug 2005 08:33:00 GMT</pubDate><guid>http://www.tkk7.com/RR00/articles/10619.html</guid><wfw:comment>http://www.tkk7.com/RR00/comments/10619.html</wfw:comment><comments>http://www.tkk7.com/RR00/articles/10619.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/RR00/comments/commentRss/10619.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/RR00/services/trackbacks/10619.html</trackback:ping><description><![CDATA[<P>鍘熸枃錛?A >http://www.onlamp.com/pub/a/bsd/2005/05/12/FreeBSD_Basics.html</A><BR>浣滆咃細<A >Dru Lavigne</A>, author of <A >BSD Hacks</A><BR>緲昏瘧錛?A href="mailto:di_feng_ro@hotmail.com">di_feng_ro@hotmail.com</A></P> <P>鏈榪戜竴涓鎴瘋仒璇蜂簡涓涓綉緇滃紑鍙戝洟闃熸潵甯姪浠栫殑宸ヤ綔榪囧害鐨勭綉綆°備粬浠姹傛垜瀹夎涓涓増鏈帶鍒剁郴緇燂紝榪欎釜緋葷粺鑳藉淇濊瘉鍥㈤槦涓殑浠諱綍鎴愬憳閬垮厤鏃犳剰涓慨鏀瑰埆浜虹殑鏂囦歡錛屽茍涓旇兘澶熺粰浜堢鐞嗗憳鎭㈠鏂囦歡鍒頒換浣曠増鏈殑鏈哄埗銆?/P> <P>鎴戠殑絎竴涓兂娉曞氨鏄疭ubversion銆傚洜涓哄畠鏄垜鍐?U><FONT color=#0000ff>BSD Hacks</FONT></U> 鏃跺拰緙栬緫鍣ㄤ竴璧風敤鐨勭増鏈帶鍒剁郴緇熴傚湪Ports Collection涓悳绱竴涓嬩箣鍚庡彂鐜幫紝Subversion闇瑕佸ソ鍑犱釜鐩稿叧鐨刾ort銆傛瘮濡傦紝esvn鐪嬭搗鏉ョ浉褰撻傚悎瀹㈡埛绔紝鍥犱負瀹冪殑GUI緇堢鑳藉榪愯鍦║nix,Mac OS X浠ュ強Windows涓傚浜庝竴涓Unix鎶鏈帉鎻′笉娣辯殑緗戠粶寮鍙戝洟闃熻岃█錛屽綋浠栦滑闇瑕佹妸鏁版嵁瀛樿串鍦‵reeBSD鏈嶅姟鍣ㄤ笂鑰屼粠闈濬reeBSD緋葷粺璇誨彇鏃訛紝esvn鏄潪甯稿ソ鐨勯夋嫨銆?/P> <P><STRONG>鍓嶆湡鍑嗗</STRONG></P> <P>鍦ㄦ垜鐨勬兂娉曚腑錛屽彧鍏佽寮鍙戝洟闃熺殑鎴愬憳鍏鋒湁鏉冮檺璁塊棶浠撳簱鏄潪甯擱噸瑕佺殑銆傚悓鏃訛紝鎴戜滑鎶婁粨搴撴斁鍦ㄥ拰鐩墠鐨剋eb鏈嶅姟鍣ㄥ垎寮鐨勬搷浣滅郴緇熶笂錛屽綋web綆$悊鍛樼湅鍒伴傚悎鐨勬枃浠舵椂錛岀敱浠栬礋璐f妸鏂囦歡浠庝粨搴撳鍒跺埌web鏈嶅姟鍣ㄤ笂銆?/P> <P>涓轟簡瀹炵幇榪欎釜鐩殑錛屽厛瀵瑰凡瀛樺湪鐨勪綘鎯蟲斁鍒扮増鏈帶鍒剁郴緇熶笅鐨勭洰褰曠粨鏋勫仛涓涓浠斤紝鐒跺悗鎶婂畠瀹夊叏鍙戦佸埌浠撳簱鏈嶅姟鍣ㄣ傚湪鎴戠殑渚嬪瓙涓紝鎴戞妸web鏈嶅姟鍣ㄤ笂www鐩綍鐨勬暟鎹浠藉埌涓鍙板唴緗戞湇鍔″櫒 192.168.2.2涓娿?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc"># tar czvf - /usr/local/etc/www/data | ssh </FONT><A href="mailto:dru@192.168.2.2"><FONT style="BACKGROUND-COLOR: #f5f5dc">dru@192.168.2.2</FONT></A><FONT style="BACKGROUND-COLOR: #f5f5dc"> "cat > </FONT><A ><FONT style="BACKGROUND-COLOR: #f5f5dc">www.tar.gz</FONT></A><FONT style="BACKGROUND-COLOR: #f5f5dc">"</FONT></P> <P>涓嬩竴姝ユ槸鍦ㄤ粨搴撴湇鍔″櫒涓婂緩绔嬩竴涓猻vn緇勶紝騫舵妸宸插瓨鍦ㄧ殑闇瑕佽闂粨搴撶殑鐢ㄦ埛鍔犲埌榪欎釜緇勪腑銆傛瘮濡傦紝褰撴垜鍒涘緩svn緇勫悗錛屾垜鍦?etc/group鍔犲叆榪欏彞璇濇妸宸插瓨鍦ㄧ殑web綆$悊鍛樼敤鎴峰姞榪涘幓錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc"># vi /etc/group<BR>svn:*:3690:webadmin</FONT></P> <P>鐒跺悗錛屾柊寤轟竴涓敤鎴穝vn銆傚鏋滄湁蹇呰錛屼綘榪橀渶鍒涘緩鎵鏈夎璁塊棶浠撳簱緋葷粺鐨勭敤鎴峰笎鍙?濡傛灉浠栦滑榪樻病鏈夊垱寤猴級銆傝淇濊瘉姣忎釜鐢ㄦ埛鏄痵vn鐨勬垚鍛樺茍涓旀湁瀵嗙爜鍜屽彲鐢ㄧ殑shell銆傛垜浣跨敤sysinstall涓烘柊鐨勭綉緇滃伐紼嬪笀寤虹珛鐢ㄦ埛甯愬彿銆傚畬鎴愪互鍚庯紝鎴戝弻鍑籹vn緇勭殑鎴愬憳銆傚ぇ姒傚氨璞¤繖鏍鳳細</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc"># grep svn /etc/group<BR>svn:*:3690:webadmin,devel1,devel2</FONT></P> <P><STRONG>澶勭悊 umask</STRONG></P> <P>鍦ㄥ畨瑁匰ubversion涔嬪墠錛屾垜浠厛鐪嬬湅svn鐢ㄦ埛鐨剈mask銆傚湪鎴戠殑FreeBSD緋葷粺涓婏紝瀹冩槸榪欐牱鐨勶細</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc"># su -l svn<BR>% umask<BR>022</FONT></P> <P>鍦║NIX涓紝鐢ㄦ埛umask鍊煎喅瀹氫簡鏂板緩鐩綍鎴栨枃浠剁殑榛樿鏉冮檺銆傝繖鏄氳繃鍏抽棴鏌愪簺鏉冮檺杈懼埌鐨勩傚鏋滀綘璁板緱錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">r = 4<BR>w = 2<BR>x = 1</FONT></P> <P>浣犲簲璇ョ湅寰楀嚭榪欎釜umask娌℃湁瀵圭敤鎴?svn)鍏抽棴浠諱綍鏉冮檺(0);瀹冨緇?svn)鍏抽棴浜嗗啓鏉冮檺(2);瀹冨鍏朵粬緇勭敤鎴峰叧闂簡鍐欐潈闄?2)銆?/P> <P>鍥犱負svn緇勭殑鎴愬憳蹇呴』鑳藉鍐欏叆浠撳簱錛屾墍浠ユ妸umask涓叧浜庣粍鐨?2 鏀逛負 0銆傜敋鑷沖鏋滀綘涓嶆兂璁╁叾浠栫粍鎴愬憳鐭ラ亾榪欎釜浠撳簱鐨勫瓨鍦紝浣犲彲浠ユ妸鍏充簬鍏朵粬緇勬垚鍛樼殑 2 鏀逛負 7銆?/P> <P>淇敼鐢ㄦ埛svn鐨剆hell閰嶇疆姣旇緝綆鍗曘傚鏋滅敤鎴蜂嬌鐢?csh:</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% vi ~svn/.cshrc</FONT></P> <P>錛岄偅涔堟壘鍒皍mask閭h騫舵妸瀹冩敼涓?002 鎴?007銆傚鏋滀綘鐨剆vn鐢ㄦ埛涓嶇敤csh錛屼慨鏀逛綘鐨剆hell閰嶇疆鏂囦歡銆傚鏋滀綘鎶婁綘鐨勪慨鏀逛繚瀛樺湪 ~svn/.cshrc (鎴栧埆鐨勫湴鏂?,鍒繕浜嗗憡璇塻hell:</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% source ~svn/.cshrc</FONT></P> <P>鍐嶆暡涓嬈?umask 鍛戒護錛屼互淇濊瘉浣犵殑淇敼鏈夋晥銆?/P> <P> </P> <P><FONT style="BACKGROUND-COLOR: #ffffff"><STRONG>瀹夎Subversion 錛屽茍璁╁畠鎷ユ湁姝g‘鐨剈mask</STRONG></FONT></P> <P>濡傛灉浣犻夋嫨涓涓?02鐨剈mask,閭d箞褰撲綘浠巔orts collection鐢熸垚Subversion鐨勬椂鍊欙紝浣犺兘鎶婁竴涓獁rapper緙栬瘧榪涘幓銆傚鏋滀綘閫夋嫨涓涓?07鐨剈mask鎴栧畨瑁呭凡棰勭紪璇戝ソ鐨凷ubversion錛岄偅灝辮鍒涘緩涓涓獁rapper鑴氭湰鏉ヤ繚璇佷綘鐨凷ubversion浜岃繘鍒舵枃浠朵嬌鐢ㄤ綘鐨剈mask鍊箋?/P> <P>浣跨敤wrapper緙栬瘧錛屼嬌鍏秛mask鍊間負002錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc"># cd /usr/ports/devel/subversion<BR># make -DWITH_SVNSERVE_WRAPPER install clean</FONT></P> <P>鎴栬咃紝浣犲彲浠ュ畨瑁呭凡棰勭紪璇戠殑浜岃繘鍒朵唬鐮佸寘</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc" color=#000000># pkg_add -r subversion</FONT></P> <P>娉ㄦ剰錛氭棤璁轟嬌鐢ㄤ綍縐嶆柟娉曪紝瀹夎涔嬪墠閮藉簲璇ユ妸榪欑瘒鏂囩珷鐪嬪畬錛佸洜涓轟綘鍙互鍙戠幇涓浜涢澶栫殑璁╀綘鎰熷叴瓚g殑緙栬瘧閫夐」錛?/P> <P>濡傛灉浣犱笉鍦╳rapper涓紪璇戯紝璇風Щ鍔ㄤ綘鐨勪唬鐮佸埌鐩稿簲鐨勪綅緗紝騫跺垱寤轟綘鑷繁鐨剋rapper鑴氭湰錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc"># mv /usr/local/bin/svn /usr/local/bin/svn.orig<BR># vi /usr/local/bin/svn<BR>#!/bin/sh<BR>#wrapper script to set umask to 007 on subversion binaries<BR>umask 007<BR>/usr/local/bin/svn.orig "$@"</FONT></P> <P>璁劇疆浣犵殑umask鍊間負002鎴?07錛屼嬌瀹冨拰syn鐢ㄦ埛鐨剈mask鍊間竴鏍楓傚埆蹇樹簡璁劇疆浣犵殑wrapper鑴氭湰涓哄彲鎵ц鐨勶細</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc"># chmod +x /usr/local/bin/svn</FONT></P> <P><BR><STRONG>鍒涘緩浠撳簱</STRONG></P> <P>鏃㈢劧鐜鎼ソ浜嗭紝閭d綘灝卞彲浠ュ垱寤轟粨搴撲簡銆傜敤svn鐢ㄦ埛鐧誨綍浠ヤ繚璇乻vn鐢ㄦ埛鍜宻vn緇勬嫢鏈変綘鍦ㄤ粨搴撲腑鍒涘緩鐨勬枃浠躲傚湪 /usr/home/svn/鐩綍涓?閿叆錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% svnadmin create repository</FONT></P> <P>鍦ㄨ繖涓緥瀛愪腑錛屾垜鐨勪粨搴撳悕涓簉epository銆備綘鍙互閫夋嫨浠諱綍瀵逛綘鏈夊府鍔╃殑鍚嶅瓧銆俿vnadmin create 浠呬粎鍒涘緩浜哠ubversion宸ュ叿鎵闇瑕佺殑鐩綍緇撴瀯銆?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% ls -F repository<BR>README.txt dav/ format locks/<BR>conf/  db/ hooks/</FONT></P> <P>娉ㄦ剰鐩綍db鏄粯璁ょ敓鎴愮殑銆傚洜涓篠ubversion浣跨敤鏁版嵁搴撹窡韙粨搴撲腑鏂囦歡鐨勫彉鍖栵紝鎵浠ヤ綘蹇呴』鎶婁綘鐨勬暟鎹斁鍒版暟鎹簱涓傜劧鍚庯紝鎴戞妸澶囦喚鏂囦歡瑙e帇緙╋紝榪欐牱灝辨湁鐨勪竴浜涘彲浠ユ斁榪涘幓鐨勬暟鎹備絾鏄娉ㄦ剰榪欎箞鍋氱殑鏃跺欙紝涓嶈鎶婂浠芥枃浠剁洿鎺ユ仮澶嶅埌~svn/repository鐩綍涓嬨?璁板緱鍚︼紝瀹冩槸涓暟鎹簱)銆傜浉鍙嶏紝鎴戞柊寤轟簡涓洰褰曠粨鏋勶細</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% pwd<BR>/usr/home/svn</FONT></P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% mkdir www && cd www<BR>% mkdir branches tags trunk<BR>% cd trunk<BR>% tar xzvf /full/path/to/www.tar.gz .<BR>% cd</FONT></P> <P>榪欐牱錛宻vn鐢ㄦ埛鐨勪富鐩綍緇撴瀯鍍忚繖鏍?</P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% ls -F ~svn<BR>repository/ www/</FONT></P> <P><BR><STRONG>瀵煎叆鏁版嵁</STRONG></P> <P>涓嬩竴姝ワ紝搴旇鎶妦svn/www/鐨勬暟鎹鍏ュ埌Subversion鏈嶅姟鍣ㄤ簡銆備負浜嗗疄鐜拌繖涓洰鐨勶紝鍙互浣跨敤 svn import 鍛戒護錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">% svn import www </FONT><A href="file:///usr/home/svn/repository/www"><FONT style="BACKGROUND-COLOR: #f5f5dc">file:///usr/home/svn/repository/www</FONT></A><FONT style="BACKGROUND-COLOR: #f5f5dc"> -m "initial import"</FONT></P> <P>svn import 鏄痵vn鐨勮澶氬懡浠や腑鐢ㄦ埛鍙互浣跨敤鐨勪竴鏉°傞敭鍏?svn help 鍙互鐪嬪埌鎵鏈夊彲浠ヤ嬌鐢ㄧ殑鍛戒護鐨勫悕瀛椼傚鏋滀綘鍦╯vn鍜宧elp涓彃鍏ュ懡浠わ紝姣斿 svn import help,浣犲氨鍙互鐪嬪埌閭f潯鍛戒護鐨勮娉曞府鍔┿傚湪svn import鍚庨潰鐨勬槸鍖呭惈瑕佸鍏ユ暟鎹殑鐩綍鐨勫悕瀛?www)銆備綘鐨勬暟鎹笉涓瀹氶潪寰楀湪鐩稿悓鐨勭洰褰曚笅錛屽畠浠呬粎鏄畾涔変簡鍒版暟鎹殑瀹屾暣璺緞錛屼絾蹇呴』淇濊瘉浣犵殑svn緇勭敤鎴鋒嫢鏈夎闂鍏ユ暟鎹殑鏉冮檺銆傛敞鎰忥細濡傛灉浣犲凡緇忓鍏ョ殑鏁版嵁錛屽師濮嬫暟鎹氨娌℃湁蹇呰鐣欏湪紜洏涓婁簡銆傚湪鎴戠殑渚嬪瓙涓紝鎴戜嬌鐢ㄤ簡榪欐潯鍛戒護錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">rm -Rf www銆?/FONT></P> <P>鎺ヤ笅鏉ワ紝璇鋒敞鎰忓綋鎴戝畾涔変粨搴撶殑瀹屾暣璺緞鏃舵墍浣跨敤鐨勮娉曘係ubversion鏀寔澶歎RL妯″紡鎴栬匯A(repository access)妯″潡銆傛楠屼綘鐨凷ubversion鏀寔鍝妯″紡錛?/P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">#svn --version<BR>svn, version 1.1.3 (r12730)<BR>   compiled Mar 20 2005, 11:04:16</FONT></P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">Copyright (C) 2000-2004 CollabNet.<BR>Subversion is open source software, see </FONT><A ><FONT style="BACKGROUND-COLOR: #f5f5dc">http://subversion.tigris.org/</FONT></A><BR><FONT style="BACKGROUND-COLOR: #f5f5dc">This product includes software developed by CollabNet (</FONT><A ><FONT style="BACKGROUND-COLOR: #f5f5dc">http://www.Collab.Net/</FONT></A><FONT style="BACKGROUND-COLOR: #f5f5dc">).</FONT></P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">The following repository access (RA) modules are available:</FONT></P> <P><FONT style="BACKGROUND-COLOR: #f5f5dc">* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.<BR>  - handles 'http' schema<BR>  - handles 'https' schema<BR>* ra_local : Module for accessing a repository on local disk.<BR>  - handles 'file' schema<BR>* ra_svn : Module for accessing a repository using the svn network protocol.<BR>  - handles svn schema</FONT></P> <P>鍥犱負鎴戞兂瑕佸湪鏈湴璺緞璁塊棶浠撳簱錛屾墍浠ユ垜浣跨敤浜?A href="file:///">file:///</A> 妯″紡銆傛垜榪樺彲浠ュ湪榪橴RL鍚庨潰鍔犱笂www錛屽洜涓烘垜鎯寵闂粨搴撲腑鍚嶄負www鐨勭洰褰曘傚綋鐒訛紝浣犺兘鍦ㄥ悓涓涓粨搴撲腑瀵煎叆澶氫釜鐩綍緇撴瀯錛屽茍涓旂敤瀹規槗璁頒綇鐨勫悕瀛楀懡鍚嶃?BR><BR>鏈鍚庯紝鎴戜嬌鐢ㄤ簡 -m 娑堟伅寮鍏蟲妸娉ㄩ噴錛?initial import"鍔犲叆浠撳簱鏃ュ織涓傚鏋滄垜涓嶅寘鎷繖涓弬鏁幫紝svn灝嗕嬌鐢ㄩ粯璁ょ紪杈戝櫒(vi)鎵撳紑鏃ュ織騫惰姹傛垜濉叆娉ㄩ噴錛屽惁鍒欐棤娉曡繘鍏ヤ笅涓姝ャ?BR><BR>榪欐槸闈炲父鍏抽敭鐨勪竴涓湴鏂廣傚畨瑁呬竴涓増鏈帶鍒剁郴緇熺殑鍏ㄩ儴鍘熷洜鏄負浜嗗厑璁歌澶氱敤鎴蜂慨鏀規枃浠訛紝騫朵笖鏈夊彲鑳芥槸騫跺彂鐨勩傛瘡涓涓敤鎴烽兘搴旇璐熻矗浠葷殑璁板綍娓呮浠栦滑瀵瑰摢浜涙枃浠朵綔浜嗗摢浜涙敼鍔ㄣ備綘鐨勫伐浣滃氨鏄浠栦滑鏄庣櫧涓轟粈涔坰vn鍛戒護鎬繪槸鎻愮ず浠栦滑鍔犲叆娉ㄩ噴銆?/P> <P><STRONG>紜畾濡備綍璁塊棶浠撳簱</STRONG></P> <P>鎭枩浣狅紒浣犵幇鍦ㄦ嫢鏈変簡涓涓彲浠ュ伐浣滅殑浠撳簱錛佺幇鍦ㄥ埌浜嗕粩緇嗘瘮杈冨悇縐嶄笉鍚岀殑URL妯″紡騫墮夊嚭鏈閫傚悎浣犻渶姹傜殑璁塊棶鏂規硶鐨勬渶濂界殑鏃墮棿銆?/P> <P>鍏嶈垂鐢靛瓙鏂囨。Version Control with Subversion絎叚绔犺緇嗕粙緇嶄簡鍚勭鍙兘鐨勯厤緗備綘鍙互鍦ㄧ紪璇慒reeBSD port鐨勬椂鍊?鍦?make 鍛戒護鍚庢坊鍔犲弬鏁?-DWITH_BOOK錛屾妸涔﹀畨瑁呬笂銆?/P> <P>濡傛灉浣犵殑鐢ㄦ埛閫氳繃鏈湴鎴杝sh鐧誨綍緋葷粺錛屽彲浠ヤ嬌鐢?<A href="file:///">file:///</A> 璁塊棶銆傚洜涓虹敤鎴峰浜庝粨搴撴椂鏈湴(local)鐨勶紝鎵浠ヨ繖縐嶆儏鍐典笅錛岀郴緇熶笉浼氭墦寮涓涓?TCP/IP绔彛鐩戝惉Subversion榪炴帴銆傜劧鑰岋紝瀹冨嵈瑕佹眰姣忎釜鐢ㄦ埛鏈変竴涓椿鍔ㄧ殑shell甯愬彿騫朵笖鍋囧畾浣犵殑鐢ㄦ埛鍙互鐧誨綍Unix鏈嶅姟鍣ㄣ傚拰鍒殑shell甯愭埛涓鏍鳳紝鍏跺畨鍏ㄦц兘鐢辮繖鍑犳柟闈㈠喅瀹氾細鐢ㄦ埛瀵嗙爜鐨勫仴澹э紱浠撳簱鏉冮檺浠ュ強緇勬垚鍛樼殑姝g‘閰嶇疆銆傝鐢ㄦ埛閫氳繃ssh鐧誨綍緋葷粺騫朵笉淇濊瘉session宸茶鍔犲瘑銆?/P> <P>鍙︿竴縐嶆柟妗堟槸鎶奡ubversion鏁村悎榪沘pache鏈嶅姟鍣ㄣ傞粯璁ゆ儏鍐典笅錛孲ubversion 鐨凢rssBSD port鏀寔SSL緙栬瘧錛岃繖鎰忓懗鐫浣犵殑鐢ㄦ埛鍙互鍦ㄦ祻瑙堝櫒涓嬌鐢?https:// 妯″紡璁塊棶浠撳簱銆傜劧鑰岋紝濡傛灉浣犵殑apache鐗堟湰鏄?.X鑰屼笉鏄?.X錛岃璁板緱鍦ㄧ紪璇戠殑鏃跺欐妸鍙傛暟-DWITH_MOD_DAV_SVN 鍔犲叆鍒?make鍚庨潰銆?/P> <P>濡傛灉浣犺冭檻璁╃敤鎴烽氳繃嫻忚鍣ㄨ闂紝瑕佸厛浠旂粏闃呰Subversion鏂囨。鍏充簬apahce httpd閰嶇疆閮ㄥ垎錛岀劧鍚庝綘瑕侀厤緗笉灝戜笢瑗褲傚垢榪愮殑鏄紝鏂囨。寰堝畬鏁達紒</P> <P>絎笁縐嶆柟妗堟椂浣跨敤 svnserve 鐩戝惉緗戠粶榪炴帴銆傛枃妗e緩璁噰鐢ㄨ繖縐嶆ā寮忥紝鏃犺鏄氳繃inetd榪樻槸鐙珛榪涚▼銆傝繖<BR>縐嶆ā寮忓厑璁稿尶鍚嶈闂垨鑰呭凡鎺堟潈鐨勭敤鎴瘋闂紝浠諱綍鏂瑰紡閮介氳繃CRAM-MD5鍔犲瘑銆傚鎴烽氳繃svn:// 璁塊棶svnserve銆?/P> <P>鎴戣涓哄尶鍚嶈闂槸涓嶆伆褰撶殑錛屾墍浠ユ垜渚濈収閰嶇疆閫夐」浣跨敤CRAM-MD5銆傜劧鑰岋紝鎴戝緢蹇彂鐜版垜鐨勭郴緇熶笂娌℃湁瀹夎CRAM-MD5銆傚湪Google涓婃悳绱㈠叧浜庢妸CRAM-MD5鏁村悎榪汼ubversion鏈嶅姟鍣ㄧ殑璧勬枡錛屼絾鏄病鏈夋壘鍒般傛垜灝卞喅瀹氬皾璇曟渶鍚庝竴縐嶆柟娉曘?BR><BR>閭e氨鏄湪鈥滈毀閬撴ā寮?tunnel mode)鈥濅腑璋冪敤svnserve,榪欑妯″紡鍙互璁╀綘鐨勭敤鎴烽櫎浜嗗彈浣犲湪/etc/ssh/sshd_config涓殑閰嶇疆綰︽潫澶栵紝榪樺彲浠ラ氳繃姝e父鐨凷SH鏈哄埗璁よ瘉銆傛瘮濡傦紝鎴戝彲浠ヤ嬌鐢ˋllowUsers鍏抽敭瀛楁帶鍒跺摢浜涚敤鎴鋒巿鏉冭闂郴緇熴傛敞鎰忥紝榪欑妯″紡浣跨敤svn+ssh://璁塊棶浠撳簱銆?/P> <P>榪欑鏂規硶鐨勫ソ澶勬槸鎴戝彲浠ヤ嬌鐢ㄥ凡鏈夌殑璁よ瘉浣撳埗鑰屼笉闇瑕佺敤鎴峰繀欏繪槸浠撳簱緋葷粺甯愭埛銆傜劧鑰岋紝榪欑妯″紡涓殑緗戠粶榪炴帴鏄病鏈夊姞瀵嗙殑錛涗嬌鐢⊿SH鍙槸涓轟簡鎺堟潈銆傚鏋滀綘鐨勬暟鎹槸鏁忔劅鐨勶紝閭d箞浣犲簲璇ヨ浣犵殑鐢ㄦ埛閫氳繃ssh鐧誨綍鍚庝嬌鐢╢ile:// 璁塊棶錛屾垨鑰呬嬌鐢╤ttps:// 璁塊棶錛屼笉榪囧繀欏繪紜厤緗ソApache銆?/P> <P>濡傛灉浣犲喅瀹氫嬌鐢╯vnserve鏈嶅姟鍣ㄥ茍涓斿湪wrapper涓紪璇戯紝瀹冨皢鐢熸垚涓涓悕涓簊vnserve.bin鐨勪簩榪涘埗鏂囦歡銆備綘蹇呴』榪欎箞鍋氱敤鎴鋒墠鑳借闂粨搴擄細</P> <P># cp /usr/local/bin/svnserve.bin /usr/local/bin/svnserve</P> <P>鍥犱負瀹冩槸Subversion鏈嶅姟鍣ㄧ殑涓閮ㄥ垎銆傚湪涓嬩竴鏈熶笓鏍忎腑錛屾垜灝嗕粙緇嶅浣曞鎴風濡備綍璁塊棶浠撳簱銆?/P> <P><BR>Dru Lavigne 鏄弗澶崕Marketbridge Technologies 鐨勮甯堝拰<A ><FONT color=#1d58d1><EM>Open Protocol Resource</EM></FONT></A>鐨勭淮鎶や漢鍛樸?/P><img src ="http://www.tkk7.com/RR00/aggbug/10619.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/RR00/" target="_blank">R.Zeus</a> 2005-08-21 16:33 <a href="http://www.tkk7.com/RR00/articles/10619.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Setting up a Secure Subversion Serverhttp://www.tkk7.com/RR00/articles/10551.htmlR.ZeusR.ZeusFri, 19 Aug 2005 14:03:00 GMThttp://www.tkk7.com/RR00/articles/10551.htmlhttp://www.tkk7.com/RR00/comments/10551.htmlhttp://www.tkk7.com/RR00/articles/10551.html#Feedback1http://www.tkk7.com/RR00/comments/commentRss/10551.htmlhttp://www.tkk7.com/RR00/services/trackbacks/10551.htmlSetting up a Secure Subversion Serverby Dru Lavigne, author of BSD Hacks


Recently a client hired a team of web developers to assist his overworked web administrator. They asked me to set up a revision-control system to ensure that no one on the team inadvertently overwrote another member's work and to give the administrator the flexibility of rolling back to any version of a file.

My first thought was Subversion, as it is the revisioning system used with my editor when writing BSD Hacks A search for subversion in the Ports Collection indicated that there are also several related ports. For example, esvn looked like an excellent match for the client, as this GUI front end works from Unix, Mac OS X, and Windows. That's perfect for a web development team short on Unix skills who would be accessing data stored on a FreeBSD server from non-FreeBSD operating systems.

This week's article demonstrates how to create a secure repository using Subversion. The next installment will show how to train your users to access the repository using a GUI client.

Preparing the System

In my scenario, it was important that only the members of the development team have access to the repository. We also chose to have the repository on a system separate from the actual web server and left it up to the web administrator to copy over files from the repository to the web server as he saw fit.

To accomplish this, start by creating a backup of the existing directory structure you wish to put under revision control, and send it securely to the repository server. In my case, I backed up the www data on the web server to an internal server at 192.168.2.2.

# tar czvf - /usr/local/etc/www/data | ssh dru@192.168.2.2 "cat > www.tar.gz"

Next, on the repository system, create a new group called svn and add to it any existing user accounts that need access to the repository. For example, I added my existing web administrator as I created the group by adding this line to /etc/group:

# vi /etc/group
svn:*:3690:webadmin

Then, create a new user called svn and, if necessary, any missing user accounts that need access to the repository. Make sure each account is a member of the svn group and has a password and a valid shell. I used sysinstall to create user accounts for the new web developers. When I finished, I double-checked the membership of the svn group. It looked something like this:

# grep svn /etc/group
svn:*:3690:webadmin,devel1,devel2

Dealing with umask

Before installing Subversion, take a close look at the existing umask for the svn user. On my FreeBSD system it was:

# su -l svn
% umask
022

In Unix, the umask value determines the default permissions of a newly created directory or file. It does this by defining which permissions to disable. If you remember:

r = 4
w = 2
x = 1

you'll see that this umask doesn't turn off any (0) permissions for the user (svn); it turns off write (2) for the group (svn); and it turns off write (2) for world.

Because the members of the svn group should be able to write to the repository, change that group 2 to a 0. If you don't want nongroup members even to be aware of the existence of the repository, also change the world 2 to a 7.

The easy part is changing the umask for the svn user's shell. If it uses csh:

% vi ~svn/.cshrc

then find the existing umask line and change it to either 002 or 007.

If your svn user has a shell other than csh, make your edit in your chosen shell's configuration file.

Once you've saved your changes to ~svn/.cshrc (or wherever), don't forget to tell the shell:

% source ~svn/.cshrc

Repeat the umask command to verify that your changes have taken place.

Installing Subversion with the correct umask

If you chose a umask of 002, you can compile a wrapper into Subversion when you build it from the ports collection. If you chose a umask of 007 or prefer to install the precompiled version of Subversion, create a wrapper script to ensure that the Subversion binaries use your umask value.

To compile in a wrapper that sets a umask of 002:

# cd /usr/ports/devel/subversion
# make -DWITH_SVNSERVE_WRAPPER install clean

Alternatively, to install the precompiled binary:

# pkg_add -r subversion

Note: before installing by either method, finish reading the article. You may find some additional compile options that interest you.

If you didn't compile in your wrapper, move your existing binary and create your own wrapper script:

# mv /usr/local/bin/svn /usr/local/bin/svn.orig
# vi /usr/local/bin/svn
#!/bin/sh
#wrapper script to set umask to 007 on subversion binaries
umask 007
/usr/local/bin/svn.orig "$@"

Set your umask to either 002 or 007 so that it is the same as the umask for your svn user.

Don't forget to make your wrapper script executable:

# chmod +x /usr/local/bin/svn

Creating the Repository

Now that your environment is set up properly, you're ready to create the repository itself. Log in as the user svn to ensure that both the svn user and the svn group own the files you create in the repository. From /usr/home/svn/, type:

% svnadmin create repository

In this example, I've called my repository repository. You can choose any name that is useful to you.

svnadmin create simply creates the directory infrastructure required by the Subversion tools:

% ls -F repository
README.txt	dav/	format	locks/
conf/		db/	hooks/

Notice that db directory? By default, Subversion uses databases to track changes to the files that you place under revision control. This means that you must import your data into those databases.

At that point, I untarred my backup so that I had some data to import. If you do this, don't restore directly into the ~svn/repository directory. (It's a database, remember?) Instead, I first made a new directory structure:

% pwd
/usr/home/svn

% mkdir www && cd www
% mkdir branches tags trunk
% cd trunk
% tar xzvf /full/path/to/www.tar.gz .
% cd

That made the svn user's home directory look like:

% ls -F ~svn
repository/	www/

Importing the Data

Next, it's time to import the information from ~svn/www/ into the Subversion databases. To do so, use the svn import command:

% svn import www file:///usr/home/svn/repository/www -m "initial import"

svn import is one of many svn commands available to users. Type svn help to see the names of all the available commands. If you insert one of those commands between svn and help, as in svn import help, you'll receive help on the syntax for that specified command.

After svn import, specify the name of the directory containing the data to import (www). Your data doesn't have to be in the same directory; simply specify the full path to the data, but ensure that your svn user has permission to access the data you wish to import. Note: once you've successfully imported your data, you don't have to keep an original copy on disk. In my case, I issued the command rm -Rf www.

Next, notice the syntax I used when specifying the full path to the repository. Subversion supports multiple URL schemas or "repository access" RA modules. Verify which schemas your svn supports with:

% svn --version
svn, version 1.1.3 (r12730)
   compiled Mar 20 2005, 11:04:16

Copyright (C) 2000-2004 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' schema
  - handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles svn schema

Because I wished to access the repository on the local disk, I used the file:/// schema. I also appended www at the very end of the URL, as I wish that particular part of the repository to be available by that name. Yes, you can import multiple directory structures into the same Subversion repository, so give each one a name that is easy for you and your users to remember.

Finally, I used the -m message switch to append the comment "initial import" to the repository log. If I hadn't included this switch, svn would have opened the log for me in the user's default editor (vi) and asked me to add a comment before continuing.

This is a very important point. The whole reason to install a revision control system is to allow multiple users to modify files, possibly even simultaneously. It's up to each user to log clearly which changes they made to which files. It's your job to make your users aware of the importance of adding useful comments whenever an svn command prompts them to do so.

Deciding Upon a URL Schema

Congratulations! You now have a working repository. Now's the best time to take a closer look at the various URL schemas and choose the access method that best suits your needs.

Chapter 6 of the freely available e-book Version Control with Subversion gives details about the possible configurations. You can choose to install the book when you compile the FreeBSD port by adding -DWITH_BOOK to your make command.

If all of your users log in to the system either locally or through ssh, use the file:/// schema. Because users are "local" to the repository, this scenario doesn't open a TCP/IP port to listen for Subversion connections. However, it does require an active shell account for each user and assumes that your users are comfortable logging in to a Unix server. As with any shell account, your security depends upon your users choosing good passwords and you setting up repository permissions and group memberships correctly. Having users ssh to the system does ensure that they have encrypted sessions.

Another possibility is to integrate Subversion into an existing Apache server. By default, the FreeBSD port of Subversion compiles in SSL support, meaning your users can have the ability to access your repository securely from their browsers using the https:// schema. However, if you're running Apache 2.x instead of Apache 1.x, remember to pass the -DWITH_MOD_DAV_SVN option to make when you compile your FreeBSD port.

If you're considering giving browser access to your users, read carefully through the Apache httpd configuration section of the Subversion book first. You'll have to go through a fair bit of configuration; fortunately, the documentation is complete.

A third approach is to use svnserve to listen for network connections. The book suggests running this process either through inetd or as a stand-alone daemon. Both of these approaches allow either anonymous access or access once the system has authorized a user using CRAM-MD5. Clients connect to svnserve using the svn:// schema.

Anonymous access wasn't appropriate in my scenario, so I followed the configuration options for CRAM-MD5. However, I quickly discovered that CRAM-MD5 wasn't on my FreeBSD system. When a Google search failed to find a technique for integrating CRAM-MD5 with my Subversion binary, I decided to try the last option.

This was to invoke svnserve in tunnel mode, which allows user authentication through the normal SSH mechanism as well as any restrictions you have placed in your /etc/ssh/sshd_config file. For example, I could use the AllowUsers keyword to control which users can authenticate to the system. Note that this schema uses svn+ssh://.

The appeal of this method is that I could use an existing authentication scheme without forcing the user to actually be "on" the repository system. However, this network connection is unencrypted; the use of SSH is only to authenticate. If your data is sensitive, either have your users use file:// after sshing in or use https:// after you've properly configured Apache.

If you decide to use the svnserve server and you compiled in the wrapper, it created a binary called svnserve.bin. Users won't be able to access the repository until:

# cp /usr/local/bin/svnserve.bin /usr/local/bin/svnserve

That's it for this installment. In the next column, I'll show how to start accessing the repository as a client.

Dru Lavigne is an instructor at Marketbridge Technologies in Ottawa and the maintainer of the Open Protocol Resource.



R.Zeus 2005-08-19 22:03 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲欧洲国产综合| 美女视频黄a视频全免费网站色 | 亚洲人妖女同在线播放| 性做久久久久免费观看| 久久久免费观成人影院| 久久精品国产亚洲AV忘忧草18 | 久久亚洲成a人片| 性色av免费观看| 在线观看免费视频网站色| 国产 亚洲 中文在线 字幕| 国产综合精品久久亚洲| 毛色毛片免费观看| 日韩精品免费在线视频| 无套内谢孕妇毛片免费看看| 亚洲精品在线播放| 久久久久噜噜噜亚洲熟女综合 | 国产免费啪嗒啪嗒视频看看| 一区二区三区四区免费视频 | 亚洲av无码一区二区三区观看| 免费一级一片一毛片| 久久久久久精品成人免费图片 | 1024免费福利永久观看网站| 一级毛片在线完整免费观看| 亚洲已满18点击进入在线观看| 国产A在亚洲线播放| 亚洲国产人成中文幕一级二级| 中文字幕无码成人免费视频| a级成人毛片免费视频高清| 国产亚洲情侣久久精品| 中文字幕亚洲码在线| 亚洲一区二区三区电影| 亚洲无码在线播放| 免费日韩在线视频| 在线观看免费为成年视频| 24小时日本电影免费看| 成在人线av无码免费高潮喷水| 免费国产在线精品一区| 亚洲AV成人片无码网站| 国产精品亚洲一区二区麻豆| 亚洲videos| 亚洲国产人成在线观看|