Linux 下安装svn服务器及错误集锦

来源:互联网 发布:淘宝网充话费优惠吗 编辑:程序博客网 时间:2024/06/06 09:17

        由于公司新买了一台服务器,然后要从新搭建svn服务器,这个任务落到了我的身上,都要过年了。好吧,抱怨是穷人的专利。不能这样,打起精神开干。前后用了一个多小时,不过还是安装好了,期间遇到了好多问题,不过都一一的解决了!

准备工作

         装有Centos6.7系统的机器一台

         Xshell远程工具 xftp 上传文件的工具

        subversion-deps-1.4.0.tar.gz 

         subversion-1.4.0.tar.gz 

         apr-util-1.5.4.tar.gz

apr-1.5.2.tar.gz

安装

         首先用自己的用户登录linux服务器,切记不要用root(防止权限太小,其他用户都不能访问)。登陆完成以后,用xftp 将文件传输到linux 服务器中。 

      

         然后我们分别解压subversion-deps-1.4.0.tar.gz    subversion-1.4.0.tar.gz 

tar –zvxf  subversion-1.4.0.tar.gz    

tar –zvxf  subversion-deps-1.4.0.tar.gz

         解压完成以后,cdsubversion-1.4.0 执行如下命令

         ./configure–prefix=/opt/svn –without-berkeley-db –with-zlib

         (注:以svnserve方式运行,不加apache编译参数。以fsfs格式存储版本库,不编译berkeley-db)

         makeclean

         make

         makeinstall

         如果记的顺利的话,在安装期间一点错误都没有的话 ,并且输入svnserve–version 显示如何信息,则表示svn安装成功了。

         svn测试svnserve –version

         如果显示如下,svn安装成功:

                   svnserve,version 1.4.0 (r21228)

                   compiledOct 12 2006, 10:18:56Copyright (C) 2000-2006 CollabNet.

                   Subversionis open source software, see http://subversion.tigris.org/

                   Thisproduct includes software developed by CollabNet (http://www.Collab.Net/).

                   Thefollowing repository back-end (FS) modules are available:

  * fs_fs : Module for working with a plain file (FSFS) repository.,

  那么下边你就不用看了,但是如果你出错了, 而且还挺多,那么你就需要好好看了。

错误1:缺少APR环境 

          如果出现如下信息

          configure: Apache Portable Runtime (APR) libraryconfiguration

          checkingfor APR... no

          configure:WARNING: APR not found

          TheApache Portable Runtime (APR) library cannot be found.

          Pleaseinstall APR on this system and configure Subversion

          withthe appropriate --with-apr option.

          Youprobably need to do something similar with the Apache

          PortableRuntime Utility (APRUTIL) library and then configure

          Subversionwith both the --with-apr and --with-apr-util options.

          configure:error: no suitable APR found

          那么你就需要将apr-util-1.5.4.tar.gz   apr-1.5.2.tar.gz传到服务器上,然后先解压apr-1.5.2.tar.gz ,然后cd apr-1.5.1 执行./configure可能会出现这个提示:cannotremove `libtoolT:No such file or directory

        解决方案

         编辑 configure文件,查找 $RM "$cfgfile"这个地方,用#注释掉,然后重新编译安装就可以了。安装完以后再解压apr-util-1.5.4.tar.gz并依次执行 ./configure , make  , make install。

这样APR环境就安装好了!

错误2subversionrequires zlib

         解决完了错误1,我们继续安装,但是在执行的时候发现还是有错误,提示subversion requires zlib,这个比较简单,一看就是没有zlib造成的。

         解决方案

         cd subversion-1.4.3/zlib

         ./configure–shared

         make 

         makeinstall 

        这样我们就安装好了,然后我们在用yum install zlib-devel 安装一下zlib-devel ,这两个文件一般都是一起用的。安装好以后。我们又可以在尝试一下了!

错误3: cannot find -lz

         尝试了以后,发现我们又失败了。又出现了如下错误

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:/app/software/subversion-1.4.3/neon/src/.libs/libneon.a(ne_request.o):relocation R_X86_64_32 against `a local symbol' can not be usedwhen making ashared object; recompile with -fPIC

/app/software/subversion-1.4.3/neon/src/.libs/libneon.a:could not read symbols: Bad value

collect2: ld returned 1 exit status

 make: ***[subversion/libsvn_ra_dav/libsvn_ra_dav-1.la] Error 1

         解决方案

        在subversion-1.4.0/neon/src/Makefie 的 CFLAGS中增加 -fPIC选项 一定要加到最前面,例如 CFLAGS = -fPIC -g -O2。

       这样我们就解决了。如果你跟我一样幸运的话, 但现在基本上所有的问题都解决了。如果你不幸运的话,那么你就在问baidu,google吧!

 

0 1