Subversion安裝記錄

程序版本:
   Subversion:1.3.2(官方下載
   SmartSVN:2.0.6(官方下載)本地下載:

安裝過程:
 1、安裝Subversion。這個過程很簡單,默認安裝就可以了,沒什麼可說的。
 2、創建Repository(可以理解爲代碼倉庫,其實除了放代碼,其他的也可以放的^_^):
   通過CMD進入命令行模式,輸入下列命令,在d:/SubversionWorkspace/pub這個目錄下建立Repository:

svnadmin create --fs-type fsfs d:/SubversionWorkspace/pub

注:之所以選擇fsfs格式,參考下面的文檔中的相關資料
相關文檔資料:
$ svnadmin create --fs-type fsfs /path/to/repos
$ svnadmin create --fs-type bdb /path/to/other/repos

Warning
Do not create a Berkeley DB repository on a network share—it cannot exist on a remote filesystem such as NFS, AFS, or Windows SMB. Berkeley DB requires that the underlying filesystem implement strict POSIX locking semantics, and more importantly, the ability to map files directly into process memory. Almost no network filesystems provide these features. If you attempt to use Berkeley DB on a network share, the results are unpredictable—you may see mysterious errors right away, or it may be months before you discover that your repository database is subtly corrupted.

If you need multiple computers to access the repository, you create an FSFS repository on the network share, not a Berkeley DB repository. Or better yet, set up a real server process (such as Apache or svnserve), store the repository on a local filesystem which the server can access, and make the repository available over a network. Chapter 6, Server Configuration covers this process in detail.

 3、添加用戶並設置權限。沒有做詳細研究,請直接參考下面的資料:
轉自:http://www.dlog.cn/html/di...

獨立運行的Subversion權限設置很簡單,首先打開snvserve.conf,去掉下面一行的註釋

authz-db = authz

然後打開同一目錄下的authz這個文件,這個文件便是整個權限控制的核心,先來看一個例子:

[groups]
dev-group = liudong,xfliang
design-group = newidea

[/]
@dev-group = rw
@design-group = r
* =

[/doc]
@design-group = rw

[/webapp]
@design-group = rw

接下來我給大家解釋一下這個文件,相信就可以明白Subversion如何來做權限控制的了。

首先我定義了兩個組,一個開發組(dev-group),一個設計組(design-group),接下來我讓dev-group對整個目錄有讀寫的權限,而design-group只有讀權限。但是接下來的兩個子目錄design-group就有讀寫權限,也就是說設計組可以讀取整個項目,但只能修改doc以及webapp這兩個子目錄。

*= 這行表示其他人不能讀寫。當然也可以直接指定某個用戶,例如我想讓liudong這個用戶可以讀寫webapp目錄,那設置如下:

[/webapp]
@design-group = rw
liudong = rw

另外有一點注意的是,修改這個文件不需要重新啓動svn服務,這點太棒了。

下面是詳細的說明Subversion自帶的authz樣例中的註釋

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to a
### single user, to a group of users defined in a special [groups]
### section, or to anyone using the '*' wildcard.  Each definition can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

 4、將Subversion註冊爲系統。將SVNServise拷貝到Subversion的安裝目錄下的bin目錄(我這裏爲:C:/Program Files/Subversion/bin)。然後在CMD中轉到剛剛那個目錄,運行下列命令:
svnserve -d -r d:/SubversionWorkspace/

注:以下是svnserve的命令選項
svnserve [選項]
有效選項:
 -d [--daemon]            : 後臺模式
 --listen-port 參數     : 監聽端口(後臺模式)
 --listen-host 參數     : 監聽主機名或IP地址(後臺模式)
 --foreground             : 在前臺運行(調試時有用)
 -h [--help]              : 顯示這個幫助
 --version                : 顯示版本信息
 -i [--inetd]             : inetd 模式
 -r [--root] 參數       : 服務根目錄
 -R [--read-only]         : force read only, overriding repository config file
 -t [--tunnel]            : 隧道模式
 --tunnel-user 參數     : 隧道用戶名(模式是當前用戶UID的名字)
 -X [--listen-once]       : 監聽一次(調試時有用)

 5、用SmartSVN連接剛剛建好的服務器  
下載文件 (已下載 22 次)

   SVNServise:將Subversion註冊爲系統服務的東東。本地下載:
下載文件 (已下載 19 次)

   TortoiseSVN:1.4.0 RC1(官方下載
安裝環境:
   Windows XP-SP2-en
發佈了3 篇原創文章 · 獲贊 0 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章