最新消息:20210917 已从crifan.com换到crifan.org

【已解决】SVN server挂了

工作和技术 crifan 3621浏览 0评论

【已解决】SVN server挂了

【问题】
之前工作正常的svn服务器,现在不能用了:
1.从windows中的Windows+R中,登陆svn服务器:
svn:\10.0.1.9
出现错误:
Can’t set position pointer in file ‘/usr/svnrepository/db/revs/903’: Invalid argument

2.从SecurtCRT登陆Linux服务器,运行svn也还是出错:
[root@localhost buildroot]# svn –help
svn: Mismatched RA version for ‘dav’: found 1.4.6, expected 1.4.2

3.运行svnadmin,也还是不行:
[crifan@localhost svnrepository]$ svnadmin –help
svnadmin: Mismatched FS module version for ‘bdb’: found 1.4.6, expected 1.4.2

【问题分析过程】

网上一人说了具体错误原因:
http://bbs.chinaunix.net/archiver/tid-1012689.html
In case anyone else comes across this – in my case, it meant that I was using the wrong version of apr & apr-util. Apache 2.2.6 requires apr >= 1.2
I found this out by trying to recompile apache using the –with-apr=/some/path config option & it told me that it needed at least 1.2.
svn doesn’t have this in their docs – they just mention 0.9 and 1.0
For the record, a recompile of apache was not necessary – simply link svn against the correct apr made svn-server & apache happy together.

另外,网上绝大多数的和此问题相关的帖子,都是说明在安装配置Apache和SVN的时候遇到此问题,可以加对应配置参数重新编译即可解决:
http://hilinux.com/bbs/thread-183-1-1.html
b、subversion
./configure –with-apxs=/web/apache/bin/apxs –with-apr=/web/apache –with-apr-util=/web/apache
make && make install
提请注意的是:没有加上后面两个参数,服务器会出现500错误,apache的error_log显示如下:
Could not fetch resource information. [500, #0]
Could not open the root of the repository [500, #22]
Can’t set position pointer in file ‘/web/www_root/svn/test/db/revs/0’: Invalid argument [500, #22]

但是,我这里是遇到已经安装好的,但是在使用过程中遇到此问题的,不知道具体如何解决。
重新安装,担心原先的SVN项目被破坏,所以要保证之前的不被破坏,而修复svn。

【最终的解决】

是别人的解决的,其最后的原因,其实很简单,之前安装目前已使用的svn的时候装在/usr/bin下的,本身服务器那边就存在一个svn是放在/usr/local/bin先得,而环境变量的顺序先加的/usr/bin,所以我们之前输入svn,系统调用的是/usr/bin下的svn,使用使用时正常的,但是最近由于改其他问题,导致将/usr/bin和/usr/local/bin的顺序变了,所以再次使用svn,就是调用的那个/usr/local/bin下的svn,并不是我们正常安装的,所以不能用。方法就是把/usr/bin和/usr/local/bin顺序更改回来即可。

【附录】

1.SVN的简单说明
http://dnbcw.com/biancheng/html/linux/DCOJ33991.html
一 svn说明
subversion是基于apr构建的。apr全称apache portable runtime library,是一个独立的且移植性很好的程序库,任何应用程序都可以使用它(apache也是基于apr开发的)。这使得subversion可以工作在任何可以执行apache的操作系统上,如windows、linux、各种bsd、macos、netware等等。
    subversion 有两种运行方式,一是可以作为apache 2.0的一个模块, 以webdav/deltav协议与外界连通;另外,也可使用subversion 自带的小型服务器程序。该程序使用的是自带的通讯协议, 可以很容易地透过ssh以tunnel方式使用。
最简单的安装subversion的方法就是使用其提供的二进制版本(在项目网站上,有rpm、deb和ports等格式的文件下载)。
访问svn的方式有 http、https、svn 、svn+ssh等,我们使用https+证书方式。

2.SVN和apr,apr-util的关系
http://wiki.iusesvn.com/index.php/Subversion%E5%92%8Capache%2Capr%2Capr-util%E7%9A%84%E5%85%B3%E7%B3%BB
Subversion和apache,apr,apr-util的关系
作者:PCplayer

很多朋友初次接触Subversion时不是很理解subversion和apache的关系。
我在这里简单说明一下svn服务器和客户端的安装说明。

服务器
subversion服务器是不需要apache的,但是可以使用apache,视具体情况来选择。
1、如果只要通过file://或svn://来访问,则不需要apache,只安装svn即可,使用svnserve来作为服务。
2、如果你要建立一个可以通过http://或https://来访问的版本库服务器,则你需要使用apache。
基于apache配置,请看http://bbs.iusesvn.com/thread-158-1-1.html

客户端
在windows下,不管你要访问的是什么类型的服务器,只要安装一个TortoiseSVN就可以了,开发者已经帮你搞定一切。
在类Linux系统下,如果你通过file://或svn://来访问,则只要编译安装svn就可以,
如果通过http://访问,则要同neon编译,
如果通过https://访问,则要同带ssl支持的neon编译,
不论怎样,都要同apr和apr-util编译。
neon、apr、apr-util也很容易获得,目前发布的subversion代码都会有一个叫做subversion-deps-xxx的文件,比如1.4.3的就是subversion-deps-1.4.3.tar.bz2

3.SVN服务器搭建完全手册
http://yycc.javaeye.com/blog/50365

4. SVN安装注意事项
http://www.diybl.com/course/4_webprogram/jsp/jsp_js/20090304/157670.html
三、安装Subversion
SVN的安装一定要注意:
SVN 依赖的APR版本要正确。如果Apache为2.0.x,对应的APR版本应为0.9.x;Apache为2.2.x,对应的APR版本应为1.2.x。 由于subversion-deps包里的APR是0.9.x的,因此编译svn时要删除从deps里解压出来的apr, apr-util,改而使用apache 2.2里提供的。
如果apache不是安装在默认路径,configure必須加上–with-apxs选项,如:./configure –with-apxs=/home/apache2/bin/apxs

转载请注明:在路上 » 【已解决】SVN server挂了

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.181 seconds, using 23.32MB memory