CONAN ZONE

          你越掙扎我就越興奮

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            0 Posts :: 282 Stories :: 0 Comments :: 0 Trackbacks
          注; 這里的/data要修改為你的httpd.confDocumentRoot 目錄或其子目錄

          /data/svnroot/  目錄結構如下
                  |-- authfile
                  |-- authz.conf
                  `-- cns_server_auto_install  我的svn庫項目目錄
                                       |-- README.txt
                                       `-- conf
                                                       `-- svnserve.conf


          1)下載并安裝相關軟件
          wget http://apache.mirrors.pair.com/apr/apr-1.3.3.tar.gz
          tar xvf apr-1.3.3.tar.gz
          cd apr-1.3.3
          ./configure --prefix=/usr/local/apr && make && make install

          cd ..

          wget http://apache.mirrors.pair.com/apr/apr-util-1.3.4.tar.gz
          tar xvf apr-util-1.3.4.tar.gz
          cd apr-util-1.3.4
          ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install

          cd ..

          wget http://subversion.tigris.org/downloads/subversion-1.6.2.tar.gz
          tar xvf subversion-1.6.2.tar.gz

          wget  http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
          tar xvf sqlite-amalgamation-3.6.13.tar.gz
          mkdir subversion-1.6.2/sqlite-amalgamation
          cp sqlite-3.6.13/sqlite3.c subversion-1.6.2/sqlite-amalgamation/

          wget http://www.webdav.org/neon/neon-0.28.4.tar.gz
          tar xvf neon-0.28.4.tar.gz
          mv neon-0.28.4 subversion-1.6.2/neon

          cd subversion-1.6.2

          ./configure --prefix=/usr/local/subversion \
                             --with-apxs=/usr/local/apache/bin/apxs \
                             --with-apr=/usr/local/apr \
                             --with-apr-util=/usr/local/apr-util \
                             --with-ssl --with-zlib=/usr/local/zlib \
                             --enable-maintainer-mode && \
                            make && make install

          cd ..

          2) 進行相關配置
          a)在/usr/local/apache/conf/httpd.conf中添加如下模塊
              LoadModule dav_svn_module     modules/mod_dav_svn.so
              LoadModule authz_svn_module   modules/mod_authz_svn.so

          b)配置svn.cnscn.org虛擬主機 并加入svn選項
             .在/usr/local/apache/conf/httpd.conf中去掉#Include conf/extra/httpd-vhosts.conf前面的#

             .創建目錄/data/svnroot
                 [root@www.cnscn.org ~]# mkdir /data/svnroot

             .在conf/extra/httpd-vhosts.conf中添加虛擬主機svn.cnscn.org (一定要注意,在/etc/hosts中添加 127.0.0.1 svn.cnscn.org)

               #svn.cnscn.org
               <VirtualHost *:80>
                  DocumentRoot /data/svnroot

                  ServerName svn.cnscn.org
                  ErrorLog /var/log/apache/org_cnscn_svn-error_log
                  CustomLog /var/log/apache/org_cnscn_svn-access_log common
           
               #這里/svn是個不存在,也不用建立的目錄,即實際上不需要/data/svnroot/svn目錄存在
               #當訪問http://svn.cnscn.org/svn/projectname時,會自動尋找/data/svnroot/projectname目錄  
                 <location /svn>
                 #告訴Apache是dav_svn_module模塊來響應/svn/的請求
                     DAV svn
                 #告訴Subersion版本庫的根目錄
                     SVNParentPath /data/svnroot
                 #指定SVN服務器的訪問控制文件的路徑
                     AuthzSVNAccessFile /data/svnroot/authz.conf

                 #激活基本認證,就是用戶名/密碼
                     AuthType Basic
                 #在認證輸入框時顯示的提示信息
                     AuthName "welcome to cnscn svn"
                 #指定使用的認證密碼文件
                     AuthUserFile /data/svnroot/authfile
                 #指定只有輸入了正確的用戶/密碼的用戶可以訪問URL
                     Require valid-user
                  </location>
              </VirtualHost>

          3)創建驗證文件
              1> /usr/local/apache/bin/htpasswd -c -b /data/svnroot/authfile username password
             2> 編輯/data/svnroot/authz.conf 內容如下:
                   [groups]
                      users = cnscn
           
                  [/]
                      @users = rw

                  [svn:/]
                      @users = rw

          4)創建svn項目庫cns_server_auto_install
               a)創建
                   /usr/local/subversion/bin/svnadmin create cns_server_auto_install

               b)修改/data/svnroot/cns_server_auto_install/conf/svnserve.conf的內容為如下
                    [general]
                    anon-access = read
                    auth-access = write
                    password-db = /data/svnroot/authfile
                    authz-db = /data/svnroot/authz.conf
                    realm = cns_server_auto_install
             
          5)重啟apache
                   [root@www.cnscn.org ~]#  /usr/local/apache/bin/apachectl restart

          6)測試
               http://svn.cnscn.org/svn/cns_server_auto_install/ 內容應會顯示出Revision ...:/

          7)導入一個項目
             [root@www.cnscn.org ~]# svn import  --username cnscn  --password 123456 -m "cnscn server auto install"  cns_server_auto_install_local http://svn.cnscn.org/svn/cns_server_auto_install/
            新增           cns_lanmp_install_090423/install.sh
            新增           cns_lanmp_install_090423/mods
            新增           cns_lanmp_install_090423/mods/mysql_proxy
            新增           cns_lanmp_install_090423/mods/mysql_proxy/install.sh
            新增           cns_lanmp_install_090423/mods/mysql_proxy/glib-2.16.4
          posted on 2009-06-20 21:13 CONAN 閱讀(1801) 評論(0)  編輯  收藏 所屬分類: SVN
          主站蜘蛛池模板: 漳浦县| 曲松县| 汕头市| 台北县| 洪雅县| 城市| 清镇市| 福贡县| 神木县| 东宁县| 靖安县| 广宁县| 平果县| 万源市| 祁阳县| 江油市| 安岳县| 湘潭市| 呼和浩特市| 吉安市| 平顺县| 海兴县| 曲麻莱县| 剑阁县| 辛集市| 盐源县| 鄂尔多斯市| 饶平县| 望奎县| 广州市| 务川| 富源县| 巍山| 东平县| 丰原市| 新巴尔虎左旗| 合水县| 仙居县| 临颍县| 博爱县| 洪湖市|