[MT]主机上安装svn客户端
授权方式:署名,非商业用途,保持一致,转载时请务必以超链接(http://www.fwolf.com/blog/post/348)的形式标明文章原始出处和作者信息及本声明。有了svn,就可以方便的获取一些程序的源码了,所以我要在MT主机上安装,注意只是客户端,并非架设svn服务器。
svn目前的最新版是1.4.4,我参考shunz的Apache+Subversion安装笔记,从http://www.axint.net/apache/apr/binaries/rpm/i386/下载了apr-1.2.8-1.i386.rpm和apr-util-1.2.8-1.i386.rpm(新版svn需要apr版本0.9.7以上,而且是必需),可是rpm -U apr*.rpm的时候系统却提示依赖性错误:
warning: apr-1.2.8-1.i386.rpm: V3 DSA signature: NOKEY, key ID 751d7f27
error: Failed dependencies:
libpq.so.3 is needed by apr-util-1.2.8-1.i386
libapr-0.so.0 is needed by (installed) httpd-2.0.52-32.3.ent.centos4.i386
libapr-0.so.0 is needed by (installed) mod_perl-1.99_16-4.5.i386
libapr-0.so.0 is needed by (installed) subversion-1.1.4-2.ent.i386
libapr-0.so.0 is needed by (installed) subversion-perl-1.1.4-2.ent.i386
apr = 0.9.4-24.5.c4.2 is needed by (installed) apr-devel-0.9.4-24.5.c4.2.i386
libaprutil-0.so.0 is needed by (installed) httpd-2.0.52-32.3.ent.centos4.i386
libaprutil-0.so.0 is needed by (installed) mod_perl-1.99_16-4.5.i386
libaprutil-0.so.0 is needed by (installed) subversion-1.1.4-2.ent.i386
libaprutil-0.so.0 is needed by (installed) subversion-perl-1.1.4-2.ent.i386
apr-util = 0.9.4-21 is needed by (installed) apr-util-devel-0.9.4-21.i386
(rpm和redhat系列不熟悉)看了半天才搞懂,rpm -U是升级,而系统中的现有apr 0.9.4版本被其他软件比如apache、mod_perl等依赖,升级过去可能就破坏依赖性关系了。如果rpm -i的话应该是安装新版本,不知道centos上不同的软件版本能否共存,考虑到合租服务器的稳定性,还是决定按照MT客服的建议,安装svn的旧版本1.3.2:
wget http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz
gunzip subversion-1.3.2.tar.gz
tar -xvf subversion-1.3.2.tar
cd subversion-1.3.2
./configure && make && make install
顺利完成,也可以下载其他形式的源码包,然后再配置svn到用户的chroot环境当中,大家就都能用了。
配置svn到chroot环境的时候需要的包很多,ldd就行,另外如果想checkout https形式的仓库,还要配置/dev下的随机数生成器:
# mknod /var/www/vhosts/chroot/dev/urandom c 1 9
不然会出错:
SSL negotiation failed: SSL disabled due to lack of entropy
基本可用了,不过checkout含有中文名称文件的仓库时,又会遇到如下错误:
svn: Can't recode string
基本可以确定是svn无法转换字符集的原因(参考),再进一步查找原因,发现竟然是centos的系统默认字符集不是utf8的,于是更改/etc/sysconfig/i18n,设定为如下内容:
LANG="en_US.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
#LANG="C"
重启服务器,root用户可以使用中文了,普通用户还不行,需要把/usr/lib/locale/en_US.utf8/配置到chroot环境中去,然后在普通用户的$HOME目录下的.bashrc或者.bash_profile文件中加入一句export LANG=en_US.UTF-8,重新登录后就可以啦,UTF8万岁!
仍然剩余一个诡异的问题,root用户无法使用https形式的仓库:
svn: SSL is not supported
注意普通用户是可以使用的,怎么回事?用whereis发现服务器上有两个svn文件:
# whereis svn
svn: /usr/bin/svn /usr/local/bin/svn /usr/share/man/man1/svn.1.gz
分别查看其版本:
# /usr/bin/svn --version
svn, version 1.1.4 (r13838)
compiled Aug 21 2005, 20:56:55
...
* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' schema
- handles 'https' schema
# /usr/local/bin/svn --version
svn, version 1.3.2 (r19776)
compiled Aug 9 2007, 16:51:43
...
* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' scheme
合着我编译了半天都是徒劳啊,服务器上早就有了svn了,我明明记得是没有啊,难道是客服在装编译套件developer’s tools package时给装上了?可看了那个包列表里也没有啊?依然诡异,忙活半天还少编译了个SSL选项进来。
也许是MT客服给装编译套件的时候,为了自己用着方便,顺手放过来一个svn?谁还有新租的DV 3.0主机麻烦确认一下好了。
参考(部分是安装svn服务器的):
- Apache chroot: the mod security way
- Installing Subversion on a MediaTemple DV 3.0 Virtual Server
- setup svn server on media temple dv or centos with plesk
- Installing Subversion with Plesk 8.0/ CentOs 4.3 as Subdomain
- CentOS Wiki - HowTos - Subversion
关于svn字符集错误以及centos字符集问题的参考:
- SWsoft > Forums > Chroot SVN Addition Problems
- www.centos.org > forum > How to enable UTF8 support?
- www.centos.org > forum > Default Character Set / Locale
- CentOS AS 3.8+4.4 不编译内核为IPTABLES添加模块
- centos 5 或者 rhel5 i18n问题
带SSL编译svn的一些资料:
- Re: SSL is not supported
- Installing the Subversion Client with SSL Support on Linux
- SSL is not supported
Bookmark and Share This Page
If you like this then please subscribe to the RSS Feed.
Save to Browser Favorites
Ask
backflip
blinklist
BlogBookmark
Bloglines
BlogMarks
Blogsvine
BuddyMarks
BUMPzee!
CiteULike
co.mments
Connotea
del.icio.us
DotNetKicks
Digg
diigo
dropjack.com
dzone
Facebook
Fark
Faves
Feed Me Links
Friendsite
folkd.com
Furl
Google
Hugg
Jeqq
Kaboodle
kirtsy
linkaGoGo
LinksMarker
Ma.gnolia
Mister Wong
Mixx
MySpace
MyWeb
Netvouz
Newsvine
PlugIM
popcurrent
Propeller
Reddit
Rojo
Segnalo
Shoutwire
Simpy
Slashdot
Sphere
Sphinn
Spurl.net
Squidoo
StumbleUpon
Technorati
ThisNext
Webride
Windows Live
Yahoo!
Email This to a Friend