下載服務端程式:
http://subversion.tigris.org/downloads/svn-win32-1.4.3.zip
下載SVN 的ECLIPSE外掛程式subeclipse:
http://subclipse.tigris.org/files/documents/906/36425/site-1.2.0.zip
至於TortoiseSVN,因為比較討厭他把檔案夾都掛上自己的菜單,所以這裡不用,
下面全用命令列和eclipse外掛程式進行操作。
解壓svn-win32-1.4.3.zip到H:/svn。
建立I:/svnroot目錄
運行CMD,執行:
sc create svnservice binpath= "/"H:/svn/bin/svnserve.exe/" --service -r I:/svnroot" displayname= "SVNService" depend= Tcpip
以上命令列要在一行裡執行
開啟電腦管理
在服務管理裡面找到svnservice,把啟動類型設為自動,並啟動他。
CMD到H:/svn/bin
執行svnadmin create I:/svnroot
安裝subeclipse
加clean參數啟動eclipse
建立SVN串連:
svn://127.0.0.1/
ok
許可權分配:
修改I:/svnroot/conf下面的三個檔案
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
### ('').
[groups]
admin =hermit
user = bob
test = test
[/]
@admin = rw
[/LMS]
@user = rw
[/TEST]
@user = rw
@test = rw
passwd檔案:
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
hermit = z
bob = bob
test = tes
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 = none
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 conf directory.
### 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 conf
### directory. 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
經過上面的配置
我們可以做到:
根目錄不能隨便瀏覽。
admin組裡面的人可以控制全部檔案
user組裡面的人可以控制LMS和TEST下的全部檔案,除LMS和TEST及其子目錄以外不能看到其它目錄
test組裡面的人只能控制TEST下的全部檔案
如果想讓大家都能看到全部檔案可以這樣修改
[/]
@admin = rw
* = r
啟動eclipse串連。
如果要切換帳號,可以在伺服器端把密碼改了,然後eclipse就會重新提示你輸入帳號密碼。