![](https://img.51dongshi.com/20250105/wz/18528761452.jpg)
系統大全為您提供1.UbuntuPC一臺,最好是最新的Ubuntu穩定版本2.執行以下命令安裝subversion:sudoapt-getupdatesudoapt-getinstallsubversion3.假設代碼svn倉庫的根路徑定為/home/svnroot,執行以下命令新建目錄:sudomkdir/home/svnroot4.新建一個代碼倉庫,假設倉庫名為:examplecd/home/svnrootsudosvnadmincreateexample此命令執行完成后會在/home/svnroot下多出來一個名為example的目錄,這就是example代碼倉庫了。5.編輯example倉庫的訪問權限即:修改/home/svnroot/example/conf下的三個文件:authzpasswdsvnserve.conf其中:passwd中保存了用戶名和密碼authz中保存了用戶組定義及各目錄的訪問權限定義svnserve.conf中保存了本代碼倉庫使用的配置(是否允許匿名用戶?指定用戶名和密碼數據庫...)這里給出一個典型的配置:passwd實例:?[users]xiaoming=1111xiaowang=2222xiaoli=3333laowang=4444shuangshuang=5555dashi=6666?authz實例(admin可以讀寫所有目錄,dev能讀寫branch,dev只讀trunk/tag):[aliases]#joe=/C=XZ/ST=Dessert/L=SnakeCity/O=SnakeOil,Ltd./OU=ResearchInstitute/CN=JoeAverage[groups]admin=xiaolidev=laowang,shuangshuang,dashi,xiaowang,xiaoming[/]@admin=rw@dev=r[/trunk]@admin=rw@dev=r[/tag]@admin=rw@dev=r[/branch]@admin=rw@dev=rwsvnserve.conf實例(關閉匿名訪問,指定用戶數據庫和鑒權數據庫):###Thisfilecontrolstheconfigurationofthesvnservedaemon,ifyou###useittoallowaccesstothisrepository.(Ifyouonlyallow###accessthroughmentthelinebelowtousethedefaultpasswordfile.password-db=passwd###Theauthz-dboptioncontrolsthelocationoftheauthorization###rulesforpath-basedaccesscontrol.Unlessyouspecifyapath###startingwitha/,thefile'slocationisrelativetothethe###directorycontainingthisfile.Ifyoudon'tspecifyan###authz-db,nopath-basedaccesscontrolisdone.###Uncommentthelinebelowtousethedefaultauthorizationfile.authz-db=authz###Thisoptionspecifiestheauthenticationrealmoftherepository.###Iftworepositorieshavethesameauthenticationrealm,theyshould###havethesamepassworddatabase,andviceversa.Thedefaultrealm###isrepository'suuid.#realm=MyFirstRepository[sasl]###ThisoptionspecifieswhetheryouwanttousetheCyrusSASL###libraryforauthentication.Defaultisfalse.###ThissectionwillbeignoredifsvnserveisnotbuiltwithCyrus###SASLsupport;tocheck,run'svnserve--version'andlookforaline###reading'CyrusSASLauthenticationisavailable.'#use-sasl=true###Theseoptionsspecifythedesiredstrengthofthesecuritylayer###thatyouwantSASLtoprovide.0meansnoencryption,1means###integrity-checkingonly,valueslargerthan1arecorrelated###totheeffectivekeylengthforencryption(e.g.128means128-bit###encryption).Thevaluesbelowarethedefaults.#min-encryption=0#max-encryption=2566.添加svn服務為系統自啟動項目-創建svnd.sh,內容如下#!/bin/bashsvnserve-d-r/home/svnroot將這個文件放在/etc/init.d/svnd.sh這個腳本的功能:啟動svn服務,只有在啟動服務后,外部的機器才能通過各種svn工具來訪問svn服務器。-添加可執行權限sudochmoda+x/etc/init.d/svnd.sh-編輯rc.localvim/etc/rc.local在exit0之前,加上/etc/init.d/svnd.sh-重啟服務器,然后執行命令:ps-e|grepsvnserve從命令結果來檢查svn服務是否已經自動的隨系統啟動。?以上就是系統大全給大家介紹的如何使的方法都有一定的了解了吧,好了,如果大家還想了解更多的資訊,那就趕緊點擊系統大全官網吧。本文來自系統大全http:///如需轉載請注明!推薦:win7純凈版