linux 上安裝SVN並匯入(個人實操)__linux

來源:互聯網
上載者:User

 原先的SVN伺服器是放在windowsPC上的,因領導要求,要在linux伺服器上架設svn,並匯入,因此做此操作。

 

首先,需要去官網上下載所需包,我下的是1.6.16,目前最高已到1.9,下載地址:

http://subversion.tigris.org/downloads/subversion-1.6.16.tar.gz
http://subversion.tigris.org/downloads/subversion-deps-1.6.16.tar.gz

同時,對一些附帶服務包進行檢測

rpm -q apr apr-util sqlite

如果沒有就yum下

 

然後安裝: ./configure --prefix=/data/svn --with-openssl=/usr/include/openssl --without-berkeley-db

編輯/etc/ld.so.conf檔案
vi /etc/ld.so.conf
添加下面一行代碼
/usr/local/lib


然後 make clean

make

make install

 

建立環境變數:  vi /etc/profile  

SVNPATH=$PATH:/data/subversion/bin
export SVNPATH

 

查詢是否安裝: svn --version

/data/svn/svnserve --version

 

 

 接下來建立使用者及目錄

useradd -d /home/svnroot svnroot

passwd svnroot

 

mkdir /data/repository

chown -R svnroot.svnroot  /data/repository
chmod -R 755 /data/repository
cd /data/subversion/bin

建立倉庫目錄

./svnadmin create /data/repository

會發現好幾個檔案夾即可

 

修改conf下的svnserve.conf,如下: anon-access = none auth-access = write

 

接下來就可以啟動svn了

svnserve -d -r /data/svn/ 

可以將其改成啟動服務:

在/etc/rc.d/init.d/目錄下建立名為svn的檔案
並設定許可權為755:chmod 755 /etc/rc.d/init.d/svn
編輯svn檔案:vi /etc/rc.d/init.d/svn #!/bin/bash SVN_HOME=/data/repository if [ ! -f / data/svn/bin/svnserve" ] then      echo "svnserver startup: cannot start"      exit fi case "$1" in      start)          echo "Starting svnserve..."          /data/svn/bin/svnserve -d -r $SVN_HOME          echo "Finished!"          ;;      stop)          echo "Stoping svnserve..."          killall svnserve          echo "Finished!"          ;;      restart)          $ 0 stop          $ 0 start          ;;      *)          echo "Usage: svn { start | stop | restart } "          exit 1 esac

 

匯入linux 之前建好的庫

svnadmin load  /data/repository  < /data/XXXXX.dump

 

以後要重啟就是得

/data/svn/bin/svnserve -d -r /data/repository/

 

要關閉的話

ps -ef|grep svnserve

然後kill掉

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.