linux subversion/centos svn 安装与配置

软件获取地址:

http://www.linuxfromscratch.org/blfs/view/svn/general/subversion.html

http://subversion.apache.org/download/

http://rpm.pbone.net rpm包获取
在安装rpm包的时候,出现错误
rpm -ivh sqlite-3.7.16-97.1.x86_64.rpm
warning: sqlite-3.7.16-97.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 9591c39b
则需要加入以下选项
--force --nodeps
./configure --prefix=/web/server/subversion/ --with-apr=/web/server/apache/ --with-apr-util=/web/server/apache/ --with-apxs=/web/server/apache/bin/apxs --with-zlib --enable-maintainer-mode

如果要安装svnmanager,则必须安装VersionControl_SVN
我一开始安装了0.5.1出现了错误Class 'PEAR_ErrorStack' not found,后来我把换成0.4.0就没有出现这样的错误
pear install VersionControl_SVN-0.4.0
网址:http://pear.php.net/package/VersionControl_SVN/download/0.4.0

svn 启动 /web/server/subversion/bin/svnserve -d -r /web/svn/repos
本地导出:/web/server/subversion/bin/svn co svn://127.0.0.1/test/ ./

错误以及错误解决办法
我在提交svn的时候,钩子程序出错,提示:
Warning: post-commit hook failed (exit code 1) with output:
subversion/svn/svn.c:2914: (apr_err=SVN_ERR_WC_LOCKED)
svn: E155004: Run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
subversion/svn/update-cmd.c:172,
subversion/libsvn_client/update.c:706,
subversion/libsvn_client/update.c:591,
subversion/libsvn_wc/lock.c:1560,
subversion/libsvn_wc/wc_db.c:13712,
subversion/libsvn_subr/sqlite.c:1117,
subversion/libsvn_wc/wc_db.c:13651: (apr_err=SVN_ERR_WC_LOCKED)
svn: E155004: Working copy '/web/tmp/test' locked
subversion/libsvn_subr/sqlite.c:312,
subversion/libsvn_subr/sqlite.c:294: (apr_err=SVN_ERR_SQLITE_READONLY)
svn: E200031: sqlite[S8]: attempt to write a readonly database
subversion/libsvn_subr/sqlite.c:691: (apr_err=SVN_ERR_SQLITE_READONLY)
svn: E200031: Additional errors:
subversion/libsvn_subr/sqlite.c:691: (apr_err=SVN_ERR_SQLITE_READONLY)
svn: E200031: sqlite[S8]: attempt to write a readonly database
网上找了很久,都没有找到答案。其实只是导出文件夹的权限造成的,只要将导出的文件夹改成755权限,用户为www用户即可。
钩子脚本
export LANG=en_US.UTF-8
/web/server/subversion/bin/svn update /web/tmp/test/ --username test --password test --non-interactive


本文固定链接: http://blog.wwllcchf.com/?p=325 | 吴文龙的个人博客

作者:wuwenlong 于2013年08月08日发表 &
linux subversion/centos svn 安装与配置 | 吴文龙的个人博客

linux subversion/centos svn 安装与配置:目前有2 条留言

  1. 板凳
    wuwenlong:

    SVN命令行:error while loading shared libraries

    错误类似信息:

    svnlook: error while loading shared libraries: libsvn_repos-1.so.0: cannot open shared object file: No such file or directory

    以下是本人在执行脚本报如上错误时,查找原因的步骤信息:

    1.执行ldd $(which svnlook),获取含有so.0:文件的信息(文件存在,为何还报错呢?):

    libsvn_repos-1.so.0 => /usr/local/lib/libsvn_repos-1.so.0 (0x00002b0260dd2000)

    2. 接着试单独执行svnlook ……,结果是正常使用的;

    3. 继续执行了whereis svnlook ,得出以下两个路径:

    usr/bin/svnlook usr/bin/local/svnlook

    4. 紧接,试着单独执行usr/bin/svnlook,结果报了一样的错误(注:脚本带有/usr/bin/env,因此脚本运行时也是使用这路径的命令)

    5. 执行ldd /usr/bin/svnlook,需要的文件真的是找不到

    libsvn_repos-1.so.0 => not found

    libsvn_fs-1.so.0 => not found

    libsvn_fs_fs-1.so.0 => not found

    libsvn_fs_base-1.so.0 => not found

    libsvn_delta-1.so.0 => not found

    libsvn_diff-1.so.0 => not found

    libsvn_subr-1.so.0 => not found

    结论:usr/bin/svnlook该路径的命令有问题

    处理:

    a.安全起见,备份下原来的

    mv /usr/bin/svnlook /usr/bin/svnlook_back

    b.重新ln一份正常的

    ln -s /usr/local/bin/svnlook /usr/bin/svnlook

    2013-08-09 下午 4:43
  2. 沙发
    紫衣若兰:

    安装好subversion后无法启动,出现如下错误:
    error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

    # ldd /web/server/subversion/bin/svnlook
    会看到这么一行
    libiconv.so.2 => Not found

    以前编译运行是可以的,可能是不久前升级了iconv库影响。在/usr/local/lib下可以找到libiconv.so.2 。
    在网上找了一下,看到如下办法解决:
    在/etc/ld.so.conf中加一行/usr/local/lib,运行ldconfig。再运行apache,OK。
    ld.so.conf和ldconfig是维护系统动态链接库的。真不明白为什么iconv库安装时不把这一步也做了。

    2013-08-20 上午 8:46