隨筆-179  評論-666  文章-29  trackbacks-0

          一、安裝
          下載
          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 閱讀(11182) 評論(4)  編輯  收藏 所屬分類: Java J2EE JSP開源開發工具使用

          評論:
          # re: windows下架設subversion服務器 2007-08-31 03:04 | peel
          too complicated! too professional!

          kan bu dong!:)  回復  更多評論
            
          # re: windows下架設subversion服務器[未登錄] 2007-09-12 08:41 | 流水
          死AA,好好的一個博客就給你老人家這么糟蹋了
            回復  更多評論
            
          # re: windows下架設subversion服務器 2008-04-05 17:51 | 魚不愛水
          兄弟謝謝了 很專業很完美  回復  更多評論
            
          # re: windows下架設subversion服務器 2008-05-11 03:47 | 老蔡
          非常好,如果是原創,作者很有專業素質,希望以后多看到這樣的文章.謝謝  回復  更多評論
            
          主站蜘蛛池模板: 尼勒克县| 子长县| 焉耆| 正宁县| 孝昌县| 礼泉县| 马山县| 咸丰县| 尼木县| 宽甸| 四会市| 新郑市| 台湾省| 蒙自县| 宝应县| 兰坪| 龙游县| 永登县| 万源市| 博客| 秭归县| 嵩明县| 鸡泽县| 辽源市| 衡阳县| 板桥市| 阜康市| 石景山区| 紫金县| 寻乌县| 获嘉县| 苏尼特右旗| 田阳县| 田林县| 瓦房店市| 长丰县| 柏乡县| 苍山县| 大宁县| 北安市| 罗江县|