下載svn的安裝文件:
wget 'http://subversion.tigris.org/downloads/subversion-deps-1.6.9.tar.gz'
wget 'http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz'
解壓安裝
1,# tar zxvf subversion-1.6.9.tar.gz
2,#tar zxvf subversion-deps-1.6.9.tar.gz
3,#cd subversion-1.6.9
4,#./configure
5,#make && make install
6,運行 svn --help
出現 如下:
usage: svn <subcommand> [options] [args] Subversion command-line client, version 1.6.9. Type 'svn help <subcommand>' for help on a specific subcommand. Type 'svn --version' to see the program version and RA modules or 'svn --version --quiet' to see just the version number.
Most subcommands take file and/or directory arguments, recursing on the directories. If no arguments are supplied to such a command, it recurses on the current directory (inclusive) by default.
Available subcommands: add blame (praise, annotate, ann) cat changelist (cl) checkout (co) cleanup commit (ci) copy (cp) delete (del, remove, rm) diff (di) export help (?, h) import info list (ls) lock log merge mergeinfo mkdir move (mv, rename, ren) propdel (pdel, pd) propedit (pedit, pe) propget (pget, pg) proplist (plist, pl) propset (pset, ps) resolve resolved revert status (stat, st) switch (sw) unlock update (up)
Subversion is a tool for version control. For additional information, see http://subversion.tigris.org/
|
1、檢查是否安裝了低版本的SVN
[root@localhost /]# rpm -qa subversion
2、卸載舊的SVN
[root@localhost modules]# yum remove subversion
安裝SVN
[root@localhost modules]# yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql
確認已安裝了svn模塊
[root@localhost /]# cd /etc/httpd/modules
[root@localhost modules]# ls | grep svn
檢驗已經安裝的SVN版本信息
[root@localhost modules]# svnserve --version
注意是svnserve
代碼庫創建
SVN軟件安裝完成後還需要建立SVN庫
[root@localhost modules]# mkdir -p /opt/svn/repositories
[root@localhost modules]# svnadmin create /opt/svn/repositories
執行上面的命令後,自動建立repositories庫,查看/opt/svn/repositories 文件夾發現包含了conf, db,format,hooks, locks, README.txt等文件,說明一個SVN庫已經建立。
配置代碼庫
進入上面生成的文件夾conf下,進行配置
[root@localhost modules]# cd /opt/svn/repositories/conf
用戶密碼passwd配置
[root@localhost password]# cd /opt/svn/repositories/conf
[root@admin conf]# vi passwd
修改passwd爲以下內容:
權限控制authz配置
[root@admin conf]# vi authz
目的是設置哪些用戶可以訪問哪些目錄,向authz文件追加以下內容:#設置[/]代表根目錄下所有的資源
服務svnserve.conf配置
[root@admin conf]# vi svnserve.conf
最後追加以下內容:
配置防火牆端口
[root@localhost conf]# vi /etc/sysconfig/iptables
添加以下內容:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
保存後重啓防火牆
[root@localhost conf]# service iptables restart
或是關閉防火牆 :service iptables stop
啓動SVN
svnserve -d -r /opt/svn/repositories
查看SVN進程
[root@localhost conf]# ps aux|grep svnserve
停止重啓SVN
[root@localhost password]# killall svnserve //停止
或kill -9 進程id
[root@localhost password]# svnserve -d -r /opt/svn/repositories // 啓動
測試
SVN服務已經啓動,使用客戶端測試連接。 (更多內容:www.aipanshi.com 愛磐石PHP學習博客)
客戶端連接地址:svn://192.168.100.200(注意是svn)
用戶名/密碼:
niejunzhong/123456
下載svn項目:
svn co 'svn://116.213.142.30:3391/Server/partnerV3'
項目的編譯使用ant請參考《》
打包:
jar -cvfM0 partnerV3.war WebRoot/
解壓:
jar -xvf partnerV3.war