一、安裝
下載
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
如:安裝到 D:\deploy\Subversion
二、建立Repository
打開命令窗口, 鍵入 :
svnadmin create --fs-type fsfs G:\svnsrc\game
三、配置Repository
進入Repository目錄,在本文中是 G:\svnsrc\game
,你會看到conf目錄,進入該目錄,你會看到svnserve.conf和passwd兩個文件
對兩個文件作如下修改
svnserve.conf
[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 conf directory.
### Uncomment the line below to use the default password file.
password-db = passwd


passwd
[users]
# harry = harryssecret
# sally = sallyssecret
alpha=123456
svnserve.conf中的[general] 和 passwd 中的 [users] 行前有#,一定要去掉,不要有空格
四、啟動subversion
打開命令窗口鍵入
svnserve -d -r G:\svnsrc
默認端口是3690,如果不幸這個端口被別的程序暫用,可以通過選項 --listen-port=綁定端口
url格式為 svn://ip地址//Repository 名,在本文中是svn://127.0.0.1/game
======
將Subversion安裝成service。讓subversion在windows自動啟動
以前的svnserve要想成為windows服務,必須依賴于svnservice或其他工具。從Subversion1.4開始,Subversion本身就集成Windows服務的工具。
1,安裝svnservice
在Windows NT中(包括Windows XP, Windows 2000, Windows 2003 Server)本身包含了一個安裝服務的工具,叫做"Service Control",也就是sc.exe。
例如我的Subversion安裝在"D:Subversion",版本庫在"D:svnroot",而我希望對應的Subversion服務名為svnservice,安裝這個svn服務的命令就可以這樣寫:
sc create svnservice
binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
displayname= "SVNService"
depend= Tcpip
請注意,因為便于察看,上面的命令分為多行,但在實際執行時應該在一行里。另外,在以前啟動svnserve時會使用"-d"選項,也就是守護進程模式,在這里不能使用,會導致服務無法啟動。同樣,"-i"和"-t"選項也不能使用。
在命令行窗口執行完這個命令之后,服務還沒有啟動,你可以繼續運行"net start svnservice"啟動這個服務,然后使用"net stop svnservice"停止服務。
另外還有兩點需要小心處理。首先,如果路徑中包括空格,一定要用“”處理“"”號,例如上面的例子中如果svnserve.exe在“c:program filessubversion”中,則命令應該寫為“binpath= ""c:program filessubversionbinsvnserve.exe"”(“”中的內容),整個命令如下,紅色部分是改變部分:
sc create svnservice
binpath= ""D:program filesSubversionbinsvnserve.exe" --service -r D:svnroot"
displayname= "SVNService"
depend= Tcpip
其次,sc對選項的格式還有要求,例如“depend= Tcpip”不能寫為“depend = Tcpip”或“depend=Tcpip”,也就是“=”前不能有空各,而后面必須有空格。
2,刪除服務
如果服務安裝的有問題,你可能需要刪除服務。要刪除前面添加的服務,只需要運行"sc delete svnservice","svnservice"就是我們創建服務時使用的名字。
3,配置服務是自動啟動
默認情況下安裝的服務不會隨Windows的啟動而啟動,為了使svn服務能夠隨Windows啟動而啟動,需要修改一下"sc create"命令(首先要刪除),增加"start= auto"選項:
sc create svnservice
binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
displayname= "SVNService"
depend= Tcpip
start= auto
當然你也可以使用圖形化的工具修改服務的屬性,你可以在“開始->運行...”中執行"services.msc",然后在界面中修改。
posted on 2007-08-29 22:13
Alpha 閱讀(11170)
評論(4) 編輯 收藏 所屬分類:
Java J2EE JSP 、
開源開發工具使用