linux源码编译安装subversion
一、下載安裝包
subversion源碼包下載
https://subversion.apache.org/download.cgi
apr源碼包
https://dist.apache.org/repos/dist/release/apr/
apr-util源碼包
https://dist.apache.org/repos/dist/release/apr/
serf源碼包
https://www.apache.org/dist/serf/
scons源碼包
https://sourceforge.net/projects/scons/files/scons
sqlite-amalgamation源碼包
http://www.sqlite.org
二、安裝必要依賴
yum -y install zlib zlib-devel openssl openssl-devel
三、安裝apr
[root@SVNSAPP1 tomcat]# tar -xvf apr-1.7.0.tar.gz [root@SVNSAPP1 apr-1.7.0]#cd /tomcat/apr-1.7.0 [root@SVNSAPP1 apr-1.7.0]#./configure --prefix=/data/apr [root@SVNSAPP1 apr-1.7.0]#make && make instlal報錯處理rm: cannot remove `libtoolT’: No such file or directory
處理:將configure文件中的RM"RM "RM"cfgfile"這行代碼注釋掉就可以了
四、安裝apr-util
[root@SVNSAPP1 tomcat]# tar -xvf apr-util-1.6.1.tar.gz [root@SVNSAPP1 tomcat]# cd apr-util-1.6.1 [root@SVNSAPP1 apr-util-1.6.1]#./configure --prefix=/data/apr-util --with-apr=/data/apr [root@SVNSAPP1 apr-util-1.6.1]# make && make install錯誤:xml/apr_xml.c:35:19: 錯誤:expat.h:沒有那個文件或目錄
處理:在https://launchpad.net/ubuntu/+source/expat/2.0.1-7.2ubuntu1.4找到了expat_2.0.1.orig.tar.gz包進行安裝,然后重新編譯通過
五、安裝scons
[root@SVNSAPP1 tomcat]# cd scons-2.5.1 [root@SVNSAPP1 scons-2.5.1]# python setup.py install --prefix=/data/scons六、安裝serf
[root@SVNSAPP1 tomcat]# cd serf-1.3.9 [root@SVNSAPP1 serf-1.3.9]# /data/scons/bin/scons PREFIX=/data/serf APR=/data/apr APU=/data/apr-util [root@SVNSAPP1 serf-1.3.9]# /data/scons/bin/scons install [root@SVNSAPP1 serf-1.3.9]# cp /data/serf/lib/libserf-1.so* /usr/local/lib/七、安裝svn
[root@SVNSAPP1 tomcat]# mkdir -p /data/subversion/sqlite-amalgamation [root@SVNSAPP1 tomcat]# unzip sqlite-amalgamation-3380200.zip -d /data/subversion [root@SVNSAPP1 subversion-1.14.1]# ./configure --prefix=/data/svn --with-apr=/data/apr --with-apr-util=/data/apr-util --with-serf=/data/serf --enable-mod-activation --with-lz4=internal --with-utf8proc=internal [root@SVNSAPP1 subversion-1.14.1]# make && make install錯誤1:cannot stat `sqlite-amalgamation-3280000’: No such file or directory
處理:需要將sqlite-amalgamation-3380200.zip此文件解壓到你當前subversion編譯安裝所處目錄的sqlite-amalgamation(自己新建)目錄中。
mv sqlite-amalgamation-3280000 subversion-1.12.0/sqlite-amalgamation
錯誤2:configure: error: Subversion requires LZ4 >= r129, or use --with-lz4=internal
解決:./configure命令添加 --with-lz4=internal選項
錯誤3:configure: error: Subversion requires UTF8PROC
解決:./configure命令添加 --with-utf8proc=internal
八、添加環(huán)境變量
[root@SVNSAPP1 subversion-1.14.1]# echo "export PATH=/data/svn/bin:$PATH" >> /etc/profile [root@SVNSAPP1 subversion-1.14.1]# source /etc/profile九、查看安裝信息
[root@SVNSAPP1 /]# svnserve --version svnserve,版本 1.14.1 (r1886195)編譯于 Apr 6 2022,11:59:08 在 x86_64-unknown-linux-gnuCopyright (C) 2021 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/下列版本庫后端(FS) 模塊可用: * fs_fs : 模塊與文本文件(FSFS)版本庫一起工作。 * fs_x : Module for working with an experimental (FSX) repository.[root@SVNSAPP1 /]# svn --version svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or directory [root@SVNSAPP1 /]#錯誤:svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or director
處理:編輯把我們拷貝serf的文件的目錄加上
十、創(chuàng)建svn倉庫
[root@SVNSAPP1 /]# mkdir -p /data/rst #創(chuàng)建代碼目錄 [root@SVNSAPP1 /]# svnadmin create /data/rst/ztylsy #創(chuàng)建svn代碼庫 [root@SVNSAPP1 /]# cd /data/rst/ztylsy [root@SVNSAPP1 ztylsy]# ls conf db format hooks locks README.txt [root@SVNSAPP1 ztylsy]#十一、svn配置路徑
配置文件存放目錄/data/rst/ztylsy/conf
1、權(quán)限配置文件 authz
[groups] # 按用戶組分權(quán)限 yh = yh_wxc,yh_ldc # yh為用戶組,等號之后的為用戶 wd = wd_lmf,wd_hlh # wd為用戶組,等號之后的為用戶 # /表示倉庫根目錄,用戶名=權(quán)限 [/] #表示/data/rst/ztylsy @yh = rw @wd = r[/yh] #/data/rst/ztylsy/yh @yh = rw # 表示yh組對yh目錄有讀寫權(quán)限第一種方式:單個添加:
[/]
admin = rw
test = r
第二種方式(后面采用此方式配置):用戶分組,再設(shè)權(quán)限
[/]
@admin = rw
@test = r
2、用戶名口令文件 passwd
[users] test = 123456 yh_wxc = Yinhai@123格式為 賬號 = 密碼,上面配置了兩個用戶test和yh_wxc。
3、svn服務(wù)配置文件 svnserve.conf
[general] #禁止匿名訪問,默認為read,參數(shù):read,write anon-access = none #授權(quán)用戶寫權(quán)限 auth-access = write #用戶密碼文件 password-db = passwd #授權(quán)登錄文件 authz-db = authz #每個svn項目認證名,建議寫項目名 realm = /data/rst/ztylsy參數(shù)一定要[general]模塊里面,要不然不生效。
十二、啟動關(guān)閉svn服務(wù)
一臺機器可以啟動多個svn服務(wù),需修改不同端口號。
[root@SVNSAPP1 conf]# svnserve -d -r /data/rst --listen-port 3690 [root@SVNSAPP1 conf]# ps -ef|grep svn root 24761 1 0 12:25 ? 00:00:00 svnserve -d -r /data/rst --listen-port 3690 root 24763 43575 0 12:25 pts/0 00:00:00 grep svn [root@SVNSAPP1 conf]# netstat -ln|grep 3690 tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN [root@SVNSAPP1 conf]# killall svnserve [root@SVNSAPP1 conf]# netstat -ln|grep 3690 [root@SVNSAPP1 conf]#十三、設(shè)置svn服務(wù)開機啟動
方法一:
修改/etc/rc.d/rc.local文件,添加如下命令
方法二:
在/etc/init.d/目錄下創(chuàng)建svn文件并設(shè)置權(quán)限755,代碼如下
chmod +x /etc/init.d/svn #添加執(zhí)行權(quán)限
其它:為便于管理建議把SVN的版本庫建在同一個目錄中/data/rst/項目1,/data/rst/項目2,/data/rst/項目3。這樣子最后在啟動的時候只要啟動最外一層目錄就可以了:svnserve -d -r /data/rst
svn的個URL就是svn://IP/項目3,svn://IP/項目2,svn://IP/項目1
十四、測試svn可用性
1、windows客戶端做chekcout。
2、新建一個文件上傳,commit提交
3、linux使用SVN命令進行checkout操作,登錄后可以看到Windows上創(chuàng)建的文件已經(jīng)出現(xiàn)cs.txt
總結(jié)
以上是生活随笔為你收集整理的linux源码编译安装subversion的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 东方联盟发现SolarWinds黑客使用
- 下一篇: linux /dev目录