新聞中心
本節(jié)介紹一下SVN設(shè)置問題,開始是在win2003enterpriseserver下用Apache+Svn設(shè)置,希望通過本節(jié)的學(xué)習(xí)大家能夠掌握Apache+SVN設(shè)置的方法,歡迎大家一起來學(xué)習(xí)。下面是具體介紹。
1.建立SVNServe服務(wù)器
1)啟動服務(wù)器程序svnserve
A:-r直接指定到版本庫(稱之為單庫svnserve方式)
比如,有一個庫project1,位于D:\svn\project1
svnserve-d-rD:\svn\project1
此種方式建立的版本庫,訪問方式為:
Svn://127.0.0.1/
B:-r指定到版本庫的上級目錄(稱之多庫svnserve方式)
同樣,有一個庫project1,位于D:\svn\project1
如果使用以下命令啟動svnserve
svnserve-d-rD:\svn
此種方式建立的版本庫,訪問方式為:
Svn://127.0.0.1/project1/。我們再來看一下Apache+SVN設(shè)置過程中如何建立權(quán)限。

創(chuàng)新互聯(lián)建站是一家專注網(wǎng)站建設(shè)、網(wǎng)絡(luò)營銷策劃、成都微信小程序、電子商務(wù)建設(shè)、網(wǎng)絡(luò)推廣、移動互聯(lián)開發(fā)、研究、服務(wù)為一體的技術(shù)型公司。公司成立十多年以來,已經(jīng)為上千多家成都門簾各業(yè)的企業(yè)公司提供互聯(lián)網(wǎng)服務(wù)?,F(xiàn)在,服務(wù)的上千多家客戶與我們一路同行,見證我們的成長;未來,我們一起分享成功的喜悅。
2.建立權(quán)限
1)svnserve.conf文件結(jié)構(gòu)分析
每個建立的版本庫下,都存在/conf/svnserve.conf文件,此文件就是用于配置此版本庫的訪問權(quán)限。
在版本庫權(quán)限配置文件svnserve.conf中,以#開頭的行為注釋。建立版本庫后,默認(rèn)文件內(nèi)容為:
- ###Thisfilecontrolstheconfigurationofthesvnservedaemon,ifyou
- ###useittoallowaccesstothisrepository.(Ifyouonlyallow###accessthroughhttp:and/orfile:URLs,thenthisfileis###irrelevant.)
- ###Visithttp://subversion.tigris.org/formoreinformation.
- [general]
- ###Theseoptionscontrolaccesstotherepositoryforunauthenticated
- ###andauthenticatedusers.Validvaluesare"write","read",
- ###and"none".Thesamplesettingsbelowarethedefaults.
- #anon-access=read
- #auth-access=write
- ###Thepassword-dboptioncontrolsthelocationofthepassword
- ###databasefile.Unlessyouspecifyapathstartingwitha/,
- ###thefile'slocationisrelativetotheconfdirectory.
- ###Uncommentthelinebelowtousethedefaultpasswordfile.
- #password-db=passwd
- ###Theauthz-dboptioncontrolsthelocationoftheauthorization
- ###rulesforpath-basedaccesscontrol.Unlessyouspecifyapath
- ###startingwitha/,thefile'slocationisrelativetotheconf
- ###directory.Ifyoudon'tspecifyanauthz-db,nopath-basedaccess
- ###controlisdone.
- ###Uncommentthelinebelowtousethedefaultauthorizationfile.
- #authzauthz-db=authz
- ###Thisoptionspecifiestheauthenticationrealmoftherepository.
- ###Iftworepositorieshavethesameauthenticationrealm,theyshould
- ###havethesamepassworddatabase,andviceversa.Thedefaultrealm
- ###isrepository'suuid.
- #realm=MyFirstRepository
此文件,大部分都以#開頭,為注釋部分。文件真實內(nèi)容只有一句:
[general]
Apache+SVN設(shè)置在以下講解時,只顯示出配置內(nèi)容,不顯示注釋。
首先來解釋以下兩句的意義:
anon-access=read
auth-access=write
anon-access表示沒有進(jìn)行驗證的用戶的功能,有三個可選項:none,read,write。
none表示沒有什么權(quán)限,此時客戶端連接服務(wù)器時,客戶端就提示進(jìn)行驗證用戶;
read表示有讀取本版本庫的內(nèi)容的權(quán)限,但不能進(jìn)行commit操作;
write表示可以進(jìn)行版本庫的讀寫的權(quán)限;
auth-access表示經(jīng)過了驗證的用戶的權(quán)限;
password-db=passwd
這個語句告訴svnserve.exe,用戶名與密碼放在passwd.文件中,對于passwd文件的結(jié)構(gòu)后面再做說明authz-db=authz
告訴svnserve.exe,項目目錄訪問權(quán)限的相關(guān)配置是放在authz.文件中,此文件的設(shè)置是細(xì)分權(quán)限,具體結(jié)構(gòu)下面將做說明;
所以,對于正常使用的版本管理,一般是要進(jìn)行驗證的,典型的/conf/svnserve.conf一般為:
[general]
anon-access=none
auth-access=write
password-db=passwd
authz-db=authz
注意:每個配置行,都要頂頭寫,沒有空格。請期待下節(jié)有關(guān)Apache+SVN設(shè)置講解。
【編輯推薦】
- SVN配置文檔新手指南
- 實用SVN配置教程淺析
- 詳解使用SVN配置自動更新WEB服務(wù)器
- Centos下SVN的安裝配置實用手冊
- SVN服務(wù)器安裝指導(dǎo)手冊
新聞名稱:Apache+Svn設(shè)置問題詳解
本文網(wǎng)址:http://m.fisionsoft.com.cn/article/cdeoppi.html


咨詢
建站咨詢
