SVN服務端安裝

一、下載安裝文件
可執行文件:http://subversion.tigris.org/files/documents/15/44049/Setup-Subversion-1.5.3.msi

二、軟件安裝
可執行文件安裝方法: 當然是雙擊直接運行Setup-Subversion-1.5.3.msi 咯。簡單吧!

三、SVN服務端環境配置

創建資源庫: 方法一>>在命令行輸入svnadmin create E:\svn_repository,建立工程,svn自動會在該目錄下建立若干文件。

資源庫配置修改:進入目錄" E:\svn_repository"
首先打開文件密碼文件"passwd"添加
George.yin = a8.com
再打開權限文件"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,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin = george.yin
# [/foo/bar]
# harry = rw
# &joe = r
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r

[/]
@admin = rw
*=r

最後打開服務配置文件"svnserve.conf"添加
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
# realm = My First Repository

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256

啓動服務: 在命令行輸入:svnserve -d 或者指定參數啓動 svnserve -d -r e:\svn

四、SVN在Eclipse中的配置

在空白處右擊---新建---資源庫位置,在URL選項中寫入:svn://localhost/),確定即可 在彈出的對話框中輸入用戶名和密碼(爲之前在文件修改的用戶名和密碼),確定 (在這一步如果出錯請參見五、可能遇到的問題1和2
右擊建立的資源庫位置,新建一個遠程文件夾,填入文件夾名,Next—Finish
右擊新建的遠程文件夾,選 導入 選項,選擇導入目標文件的目錄,點擊確定即可
打開file菜單---New---Others….---SVN---從SVN中出去項目---next---選定資源庫位置---Next---選擇目標遠程文件夾---Next---爲項目命名---Finish
五、可能遇到的問題 Svn中文網

遇到eclipse重啓的問題解決方法:設置我的電腦》高級》環境變量中的 APR_ICONV_PATH 指向svn-win32-1.5.5.zip zip包解壓後的 iconv文件夾。
eclipse中 SVN Repository 視圖中添加資源時會出現錯誤如:svn: No repository found in 'svn://localhost/svn/demo' 這時需要重新啓動SVN服務改用這樣的命令svnserve -d -r e:\svn\demo 啓動時指定具體的路徑,另外這樣也行svnserve -d -r e:\svn 這時只指定了一個路徑添加eclipse中添加時則用'svn://localhost/demo' 就行了。


安裝成服務:
sc create svn binpath= "E:\dev\install\subversion\bin\svnserve.exe --service -r E:\svn_repository" displayname= "svnservice" depend= tcpip start= auto

說明:
svn : 這個名字是實質的服務名,displayname是現實名
E:\dev\install\subversion\bin\svnserve.exe爲安裝目錄下的bin\svnserve.exe
--service:注意是兩個--,寫成-service是會出錯的
E:\svn_repository:在安裝時(svnadmin create E:\svn_repository)的目錄
Displayname:服務顯示名
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章