隨筆-179  評(píng)論-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
          ,你會(huì)看到conf目錄,進(jìn)入該目錄,你會(huì)看到svnserve.conf和passwd兩個(gè)文件

          對(duì)兩個(gè)文件作如下修改

          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]  行前有#,一定要去掉,不要有空格


          四、啟動(dòng)subversion

          打開命令窗口鍵入
               svnserve -d -r G:\svnsrc

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

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



          ======

          將Subversion安裝成service。讓subversion在windows自動(dòng)啟動(dòng)

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


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

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

                sc create svnservice
                binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
                displayname= "SVNService"
                depend= Tcpip
               
          請(qǐng)注意,因?yàn)楸阌诓炜矗厦娴拿罘譃槎嘈校趯?shí)際執(zhí)行時(shí)應(yīng)該在一行里。另外,在以前啟動(dòng)svnserve時(shí)會(huì)使用"-d"選項(xiàng),也就是守護(hù)進(jìn)程模式,在這里不能使用,會(huì)導(dǎo)致服務(wù)無法啟動(dòng)。同樣,"-i"和"-t"選項(xiàng)也不能使用。

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

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

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


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


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

                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) 評(píng)論(4)  編輯  收藏 所屬分類: Java J2EE JSP開源開發(fā)工具使用

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

          kan bu dong!:)  回復(fù)  更多評(píng)論
            
          # re: windows下架設(shè)subversion服務(wù)器[未登錄] 2007-09-12 08:41 | 流水
          死AA,好好的一個(gè)博客就給你老人家這么糟蹋了
            回復(fù)  更多評(píng)論
            
          # re: windows下架設(shè)subversion服務(wù)器 2008-04-05 17:51 | 魚不愛水
          兄弟謝謝了 很專業(yè)很完美  回復(fù)  更多評(píng)論
            
          # re: windows下架設(shè)subversion服務(wù)器 2008-05-11 03:47 | 老蔡
          非常好,如果是原創(chuàng),作者很有專業(yè)素質(zhì),希望以后多看到這樣的文章.謝謝  回復(fù)  更多評(píng)論
            
          主站蜘蛛池模板: 祁连县| 屯留县| 肃北| 黎川县| 湘阴县| 龙游县| 贵阳市| 桦川县| 东平县| 大渡口区| 沈阳市| 龙游县| 信阳市| 通榆县| 屏南县| 龙岩市| 南安市| 县级市| 东安县| 寿光市| 迁安市| 拜城县| 元阳县| 瑞安市| 巴楚县| 太湖县| 阿克陶县| 淳化县| 宝山区| 于田县| 廉江市| 嘉义县| 保靖县| 奇台县| 颍上县| 济源市| 富民县| 肇庆市| 邵阳县| 那坡县| 尼木县|