java技術(shù)研究

          統(tǒng)計(jì)

          留言簿(3)

          閱讀排行榜

          評(píng)論排行榜

          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協(xié)議支持;–enable-so允許運(yùn)行時(shí)加載DSO模塊,前兩個(gè)參數(shù)是必須要加的,–prefix 是安裝的位置。如果configure通過,接著執(zhí)行
          數(shù)分鐘后就完事了,通過 /opt/apache/bin/apachectl start 來啟動(dòng),在瀏覽器中訪問IP比如本機(jī)訪問127.0.0.1,如果出現(xiàn) It’s Works!,那么說明安裝成功。

          目錄授權(quán)
          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
          這幾個(gè)是必須的模塊,出了問題檢查一下有沒有加載
          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個(gè)需要從該目錄拷貝過來,并且引入,如果不引入無法和svn協(xié)同。
          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

          這個(gè)加到最下面用來和svn協(xié)同
          <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倉(cāng)庫(kù)的創(chuàng)建和權(quán)限配置
          mkdir -p /opt/svn/
          創(chuàng)建apache賬戶,使通過apache訪問url的時(shí)候可以瀏覽該目錄
          新建一個(gè)文件需要-c,以后就不需要加了,passwd文件一定要用命令,明碼是不行的
          htpasswd -c /opt/svn/passwd wxq
          htpasswd /opt/svn/passwd caowei

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

          創(chuàng)建子倉(cāng)庫(kù)
          svnadmin create /opt/svn/home

          7.啟動(dòng)/重啟/關(guān)閉apache
          /opt/apache/bin/apachectl start
          /opt/apache/bin/apachectl restart
          /opt/apache/bin/apachectl stop


          8.檢測(cè)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
          如果已經(jīng)有svn在運(yùn)行,可以換一個(gè)端口運(yùn)行
          svnserve -d -r /opt/svn/ --listen-port 3391

          查看版本
          svnserve --version

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

          查看是否安裝了httpd,可以使用httpd --version檢測(cè)是否已經(jīng)卸載
          rpm -q httpd

           

           

           

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


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 义马市| 萝北县| 朝阳市| 内黄县| 密云县| 淮阳县| 建平县| 北海市| 瑞丽市| 宜君县| 云林县| 城固县| 得荣县| 旬阳县| 古浪县| 玛沁县| 安宁市| 公安县| 鄂伦春自治旗| 嘉定区| 潞城市| 元朗区| 特克斯县| 云南省| 河曲县| 田东县| 英超| 荆门市| 拉萨市| 长垣县| 察哈| 七台河市| 商南县| 兰溪市| 九江县| 谷城县| 衢州市| 镇平县| 宁化县| 湘潭县| 中牟县|