隨筆-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

          進(jìn)入Repository目錄,在本文中是 G:\svnsrc\game
          ,你會看到conf目錄,進(jìn)入該目錄,你會看到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

          默認(rèn)端口是3690,如果不幸這個端口被別的程序暫用,可以通過選項 --listen-port=綁定端口

          url格式為  svn://ip地址//Repository 名,在本文中是svn://127.0.0.1/game



          ======

          將Subversion安裝成service。讓subversion在windows自動啟動

          以前的svnserve要想成為windows服務(wù),必須依賴于svnservice或其他工具。從Subversion1.4開始,Subversion本身就集成Windows服務(wù)的工具。


          1,安裝svnservice
          在Windows NT中(包括Windows XP, Windows 2000, Windows 2003 Server)本身包含了一個安裝服務(wù)的工具,叫做"Service Control",也就是sc.exe。

          例如我的Subversion安裝在"D:Subversion",版本庫在"D:svnroot",而我希望對應(yīng)的Subversion服務(wù)名為svnservice,安裝這個svn服務(wù)的命令就可以這樣寫:

                sc create svnservice
                binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
                displayname= "SVNService"
                depend= Tcpip
               
          請注意,因為便于察看,上面的命令分為多行,但在實際執(zhí)行時應(yīng)該在一行里。另外,在以前啟動svnserve時會使用"-d"選項,也就是守護(hù)進(jìn)程模式,在這里不能使用,會導(dǎo)致服務(wù)無法啟動。同樣,"-i"和"-t"選項也不能使用。

          在命令行窗口執(zhí)行完這個命令之后,服務(wù)還沒有啟動,你可以繼續(xù)運(yùn)行"net start svnservice"啟動這個服務(wù),然后使用"net stop svnservice"停止服務(wù)。

          另外還有兩點需要小心處理。首先,如果路徑中包括空格,一定要用“”處理“"”號,例如上面的例子中如果svnserve.exe在“c:program filessubversion”中,則命令應(yīng)該寫為“binpath= ""c:program filessubversionbinsvnserve.exe"”(“”中的內(nèi)容),整個命令如下,紅色部分是改變部分:

                sc create svnservice
                binpath= ""D:program filesSubversionbinsvnserve.exe" --service -r D:svnroot"
                displayname= "SVNService"
                depend= Tcpip
               
          其次,sc對選項的格式還有要求,例如“depend= Tcpip”不能寫為“depend = Tcpip”或“depend=Tcpip”,也就是“=”前不能有空各,而后面必須有空格。


          2,刪除服務(wù)
          如果服務(wù)安裝的有問題,你可能需要刪除服務(wù)。要刪除前面添加的服務(wù),只需要運(yùn)行"sc delete svnservice","svnservice"就是我們創(chuàng)建服務(wù)時使用的名字。


          3,配置服務(wù)是自動啟動
          默認(rèn)情況下安裝的服務(wù)不會隨Windows的啟動而啟動,為了使svn服務(wù)能夠隨Windows啟動而啟動,需要修改一下"sc create"命令(首先要刪除),增加"start= auto"選項:

                sc create svnservice
                binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
                displayname= "SVNService"
                depend= Tcpip
                start= auto
               
          當(dāng)然你也可以使用圖形化的工具修改服務(wù)的屬性,你可以在“開始->運(yùn)行...”中執(zhí)行"services.msc",然后在界面中修改。



           

          posted on 2007-08-29 22:13 Alpha 閱讀(11174) 評論(4)  編輯  收藏 所屬分類: Java J2EE JSP開源開發(fā)工具使用

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

          kan bu dong!:)  回復(fù)  更多評論
            
          # re: windows下架設(shè)subversion服務(wù)器[未登錄] 2007-09-12 08:41 | 流水
          死AA,好好的一個博客就給你老人家這么糟蹋了
            回復(fù)  更多評論
            
          # re: windows下架設(shè)subversion服務(wù)器 2008-04-05 17:51 | 魚不愛水
          兄弟謝謝了 很專業(yè)很完美  回復(fù)  更多評論
            
          # re: windows下架設(shè)subversion服務(wù)器 2008-05-11 03:47 | 老蔡
          非常好,如果是原創(chuàng),作者很有專業(yè)素質(zhì),希望以后多看到這樣的文章.謝謝  回復(fù)  更多評論
            
          主站蜘蛛池模板: 雷州市| 葵青区| 盐山县| 大足县| 剑阁县| 阿瓦提县| 钦州市| 鄂伦春自治旗| 喀喇| 休宁县| 双柏县| 平安县| 天祝| 肃宁县| 五家渠市| 枣庄市| 壶关县| 开原市| 金塔县| 大余县| 论坛| 从江县| 和龙市| 嘉荫县| 德钦县| 会昌县| 河东区| 淳安县| 丹巴县| 台中市| 聊城市| 武宣县| 南投县| 大宁县| 朝阳市| 乐清市| 普陀区| 阿城市| 临江市| 彰化市| 阿拉尔市|