这2天负责架设一个支付业务的webserver测试项目,安装svn客户端的时候出现了各种问题,来记录下。
一、简单的说下安装过程:
#下载 | |
wget http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz | |
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.9.tar.gz | |
#解压 | |
tar zxvf subversion-1.6.9.tar.gz | |
tar zxvf subversion-deps-1.6.9.tar.gz | |
#编译 | |
cd subversion-1.6.9 | |
./configure --prefix=/usr/local/svn --without-berkeley-db | |
make | |
make install |
执行svn –version查看是否有版本输出,如果提示找不到命令,则如下编辑/etc/profile
vim /etc/profile
在后面追加SVN变量即可:
#追加 | |
export SVN_HOME=/usr/local/svn | |
export PATH=$SVN_HOME/bin:$PATH | |
#刷新 | |
source /etc/profile |
二、安装过程中出现的问题:
1、提示OpenSSL缺失
configure配置SVN时可能提示如下错误信息:
configure: error: We require OpenSSL; try –with-openssl
解决方法:编译前先安装了一个openssl即可
cd /usr/local/src | |
wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz | |
tar -zxvf openssl-1.0.0a.tar.gz | |
cd openssl-1.0.0a | |
./config | |
./config -t | |
make depend | |
make | |
make test | |
make install |
安装之后会在/usr/local下生成一个ssl目录,编译SVN时加上openssl路径即可:
./configure --prefix=/usr/lcoal/svn --without-berkeley-db --with-openssl=/usr/local/ssl |
2. zlib依赖缺失
configure配置SVN时可能提示如下错误信息:
configure: error: subversion requires zlib
解决办法:安装zlib
cd /usr/local/src | |
wget http://zlib.net/zlib-1.2.8.tar.gz | |
tar -xvzf zlib-1.2.8.tar.gz | |
cd zlib-1.2.8 | |
./configure | |
make | |
make install |
3、expat依赖缺失
configure配置SVN时可能提示如下错误信息:
configure: error: no XML parser was found: expat or libxml 2.x required
解决办法:安装expat
cd /usr/local/src | |
wget http://nchc.dl.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz | |
tar -zxvf expat-2.1.0.tar.gz | |
cd expat-2.1.0 | |
./configure | |
make | |
make install |
3、SQLite依赖缺失
报错信息如下:
get the sqlite 3.7.6.3 amalgamation from: | |
http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz | |
unpack the archive using tar/gunzip and copycopy sqlite3.c from the | |
resulting directory to: | |
/home/software/subversion-1.7.0-rc3/sqlite-amalgamation/sqlite3.c | |
configure: error: Subversion requires SQLite |
如果按照文章开头的方法安装,则不会出现此错误
解决办法:加入sqlite3.c模块后再编译
①、下载报错信息里面的sqlite-amalgamation-3.7.6.3.tar.gz并解压:
wget http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz
②、在svn源码目录创建sqlite-amalgamation文件夹
cd subversion-1.6.9
mkdir sqlite-amalgamation
③、拷贝sqlite-amalgamation-3.7.6.3.tar.gz解压后的sqlite3.c到sqlite-amalgamation文件夹:
cp ../sqlite-amalgamation-3070800/sqlite3.c ./sqlite-amalgamation/
④、重新编译svn即可。
4、/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
报错信息如下:
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s23_clnt.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC | |
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value | |
collect2: ld returned 1 exit status | |
make[1]: *** [libserf-0.la] Error 1 | |
make[1]: Leaving directory `/usr/local/src/subversion-1.6.9/serf' | |
make: *** [external-all] Error 1 |
解决办法:添加 –without-serf 参数重新编译subversion即可,比如:
./configure --prefix=/usr/local/svn --without-berkeley-db --without-serf |
5、不支持http://方式
全部安装完成,使用如下命令配置svn的时候:
svn co http://192.168.1.101/deploy/trunk/project
会提示“无法识别的url方案(一般需要svn://,http://,file:///等开头)”http://192.168.1.101…”
Ps:如果是按照文章开始的方法安装,应该不会出现这个问题。
解决办法:安装neon让svn来支持http和https方式
wget http://www.webdav.org/neon/neon-0.29.6.tar.gz tar | |
tar zxvf neon-0.29.6.tar.gz tar | |
cd neon-0.29.6 | |
./configure --prefix=/usr/local/neon --with-ssl=openssl | |
make | |
make install |