最近捣腾了一个美国vps,把博客之类的都移民到国外去,由于平时常要在家里和公司来回切换,所以顺便用作平时同步的服务器。
虽然Google这个大好人提供了免费的SVN服务器,但是,他是全公开的,我个人除了代码外,可能还要同步些敏感信息。又想过付费买些SVN或GIT的服务,不靠谱的不敢买,靠谱的价格又贵,还不如自己买个VPS,放心多了,话不多说,开工。
这台VPS买了的时候是提供商给我装的干净的CentOS5.4,不过它太干净了,很多软件开发包都没有装上,杯具,但是本着“缺啥补啥”的原则,其实也不麻烦。
VPS上的WEB Server是nginx,简单,配置文件简洁,但功能很强大,所以我一直摒弃庞大笨重的Apache,既然不用Apache,自然也不想为了装SVN而去装个Apache,下面讲讲我装的过程,留个备份。
先下载最新的SVN源码包并解压:http://subversion.apache.org/
$bash# wget http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz $bash# tar xzvf subversion-1.6.9.tar.gz $bash# cd subversion-1.6.9
配置并检测编译环境:
$bash# ./configure --prefix=/usr/local/svn --with-ssl configure: Configuring Subversion 1.6.9 configure: creating config.nice checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes ... checking for APR... no configure: WARNING: APR not found The Apache Portable Runtime (APR) library cannot be found. Please install APR on this system and supply the appropriate --with-apr option to 'configure' or get it with SVN and put it in a subdirectory of this source ... Whichever of the above you do, you probably need to do something similar for apr-util, either providing both --with-apr and --with-apr-util to 'configure', or getting both from SVN with: ...
一大堆checking之后,configure中断,提示无法找到APR和APR-util,原来SVN需要Apache的两个。其实我也不知道APR和APR-util是啥,于是网上Google之,翻来翻去找到了这个http://svn.haxx.se/dev/archive-2010-01/0545.shtml,一个名叫subversion-deps的东西,包含了离开apache安装SVN所依赖的东西,就在原来下载SVN源码的下方。这下好了,下到服务器,放在和svn源码同一级目录下,解压,然后再次执行configure,又报以下错误:
configure: checking sqlite library amalgamation not found at /usr/local/src/subversion-1.6.9/sqlite-amalgamation/sqlite3.c checking sqlite3.h usability... no checking sqlite3.h presence... no checking for sqlite3.h... no checking sqlite library version (via pkg-config)... no An appropriate version of sqlite could not be found. We recommmend 3.6.13, but require at least 3.4.0. Please either install a newer sqlite on this system
提示所需要的SQLite版本过低,前往它给出的URL下载并直接configure&&make&&make install,继续回到svn源码目录,configure之,期待着万事大吉。
configure: creating ./config.status config.status: creating Makefile config.status: creating sqlite3.pc config.status: creating config.h config.status: executing libtool commands
OK,检测完成,可以开始编译了,运行make命令;
tclsh ./tool/mksqlite3h.tcl . >sqlite3.h /bin/sh: tclsh: command not found make: *** [sqlite3.h] Error 127
编译终止,貌似缺少tcl,好嘛,继续本着“缺啥补啥”的原则,yum install tcl,再make,make install,一路下来终于没有报错了,这下可万事大吉了,首先得感谢国家让我接受长达9年得有偿义务教育,才能让我能看得到这么多单词。
