java技術研究

          統計

          留言簿(3)

          閱讀排行榜

          評論排行榜

          linux上安裝svn

          1.安裝apr和apr-util
          apr, apr-util: http://apr.apache.org/
          tar zxvf apr-1.5.1.tar.gz
          cd apr-1.5.1
          ./configure --prefix=/opt/apr
          make && make install

          tar zxvf apr-util-1.5.4.tar.gz
          cd apr-util-1.5.4
          ./configure --prefix=/opt/apr-util --with-apr=/opt/apr/
          make && make install


          2.安裝apache下載地址:http://www.apache.org/dist//httpd/httpd-2.2.27.tar.gz
          cd /opt
          tar -zxvf httpd-2.4.10.tar.gz
          cd /opt/httpd-2.4.10
          ./configure --prefix=/opt/apache --with-apr=/opt/apr/ --with-apr-util=/opt/apr-util/ --with-pcre=/opt/pcre --enable-so --enable-dav --enable-dav-fs
          make && make install
          其中,–enable-dav允許Apache提供DAV協議支持;–enable-so允許運行時加載DSO模塊,前兩個參數是必須要加的,–prefix 是安裝的位置。如果configure通過,接著執行
          數分鐘后就完事了,通過 /opt/apache/bin/apachectl start 來啟動,在瀏覽器中訪問IP比如本機訪問127.0.0.1,如果出現 It’s Works!,那么說明安裝成功。

          目錄授權
          chmod 777 /opt/svn
          chown -R daemon:daemon /opt/svn

          3.安裝sqlite,http://www.sqlite.org/download.html
          這里下載的是sqlite-autoconf-3080701.tar.gz,我下載到了/root/install并解壓
          tar zxvf sqlite-autoconf-3080701.tar.gz
          cd /root/install/sqlite-autoconf-3080701
          ./configure --prefix=/opt/sqlite
          make && make install

          4安裝SVN
          http://subversion.apache.org/download/下載最新版本,老版本在http://archive.apache.org/dist/subversion/
          tar -zxvf subversion-1.8.10.tar.gz
          cd  /opt/subversion-1.8.10
          ./configure --prefix=/opt/subversion --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-apxs=/opt/apache/bin/apxs --with-openssl --with-zlib --enable-maintainer-mode --with-sqlite=/opt/sqlite

          有可能需要安裝zlib1:
          configure: error: subversion requires zlib
          http://zlib.net/下載,http://zlib.net/zlib-1.2.8.tar.gz,上傳到/opt
          cd /opt
          tar zxvf zlib-1.2.8.tar.gz
          cd zlib-1.2.8
          ./configure
          make && make install

          5.修改Apache配置,httpd.conf最下面追加,直接在根目錄下建密碼
          cd /opt/apache/conf下載httpd.conf
          這幾個是必須的模塊,出了問題檢查一下有沒有加載
          LoadModule authn_file_module modules/mod_authn_file.so
          LoadModule authz_host_module modules/mod_authz_host.so
          LoadModule dav_module modules/mod_dav.so

          #下面2個需要從該目錄拷貝過來,并且引入,如果不引入無法和svn協同。
          cp /opt/subversion/libexec/mod_authz_svn.so /opt/apache/modules
          cp /opt/subversion/libexec/mod_dav_svn.so /opt/apache/modules

          LoadModule dav_svn_module modules/mod_dav_svn.so
          LoadModule authz_svn_module modules/mod_authz_svn.so

          這個加到最下面用來和svn協同
          <Location /svn>
           DAV svn
           SVNListParentPath on   //很重要
           SVNParentPath /opt/svn
           AuthType Basic
           AuthName "please input username/password"
           AuthUserFile  /opt/svn/passwd
           AuthzSVNAccessFile /opt/svn/authz
           Require valid-user
          </Location>


          6.svn倉庫的創建和權限配置
          mkdir -p /opt/svn/
          創建apache賬戶,使通過apache訪問url的時候可以瀏覽該目錄
          新建一個文件需要-c,以后就不需要加了,passwd文件一定要用命令,明碼是不行的
          htpasswd -c /opt/svn/passwd wxq
          htpasswd /opt/svn/passwd caowei

          另外需要建一個群組權限文件到/opt/svn/authz, @代表群組,這里聲明了一個admin組,admin組有讀寫權限
          [groups]
          admin=wxq
          [/]
          @admin=rw
          [home:/]
          @admin=rw

          創建子倉庫
          svnadmin create /opt/svn/home

          7.啟動/重啟/關閉apache
          /opt/apache/bin/apachectl start
          /opt/apache/bin/apachectl restart
          /opt/apache/bin/apachectl stop


          8.檢測SVN 端口
          [root@localhost conf]#netstat -ln |grep 3690
          tcp  0  0 0.0.0.0:3690    0.0.0.0:*     LISTEN
          停止重啟SVN
          killall svnserve
          svnserve -d -r /opt/svn
          如果已經有svn在運行,可以換一個端口運行
          svnserve -d -r /opt/svn/ --listen-port 3391

          查看版本
          svnserve --version

          查看是否安裝了svn
          rpm -q subversion

          查看是否安裝了httpd,可以使用httpd --version檢測是否已經卸載
          rpm -q httpd

           

           

           

          posted on 2014-10-24 16:56 小秦 閱讀(297) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 包头市| 百色市| 甘孜县| 丰宁| 龙里县| 宁德市| 道孚县| 阳原县| 徐水县| 阿荣旗| 三原县| 白河县| 台北市| 清水河县| 长子县| 二手房| 定边县| 石门县| 凌云县| 砀山县| 迁安市| 色达县| 福鼎市| 南木林县| 花莲县| 安陆市| 阿克陶县| 光山县| 察雅县| 壤塘县| 喀什市| 莒南县| 临泽县| 柳河县| 浏阳市| 尼玛县| 洛隆县| 揭西县| 仙桃市| 安吉县| 孟州市|