subversion for linux的安装(SVN+apache+linux) ——转载

subversion for linux的安装(SVN+apache+linux)
关键词: SVN    apache    linux    subversion                                          

1、安装APR-1.2.7和APR-util-1.2.7

    下载地址:[url]http://apr.apache.org/[/url]   

    tar zxvf  apr-1.2.7.tar.gz

   ./configure

    make

    make install

    tar zxvf apr-util-1.2.7.tar.gz

    ./configure --with-apr=/usr/local/apr/

     make

     make install

2、编译安装APACHE。

    tar zxvf httpd-2.2.3.tar.gz
    cd httpd-2.2.3
    ./configure --prefix=/opt/apache --enable-dav --enable-so --enable-maintainer-mode --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config

     make
     make install

3、安装subversion-1.4.0

     tar zxvf subversion-1.4.0.tar.gz

     ./configure --with-apxs=/opt/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr

     make

     make install

4、查看subversion两个动态库有没有安装成功

     vi /opt/apache/conf/httpd.conf

    看到下面两个模块说明安装成功

     LoadModule dav_svn_module     modules/mod_dav_svn.so
     LoadModule authz_svn_module   modules/mod_authz_svn.so

5、配置SVN

    vi /opt/apache/conf/httpd.conf

     以下大概是我的配置:

    <Location /svn>
       DAV svn
        SVNParentPath /data/svn/repos
        AuthType Basic
        AuthName "Subversion repository"
        AuthUserFile /data/svn/passwd
        AuthzSVNAccessFile /data/svn/auth
        Require valid-user
    </Location>
6、建立SVN存储仓库

     #mkdir -p /data/svn/repos

    #svnadmin create /data/svn/repos/tony.tang

    备份以前的SVN库

    #svnadmin dump /data/svn/repos/tony.tang/ > /root/tony.tang

    把备份出来的数据恢复到本地

    #svnadmin load /data/svn/repos/tony.tang/ < /home/tony.tang

7、建立本地访问控制文件

    /opt/apache/bin/htpasswd -c /data/svn/passwd clay.li

   会提示你输入密码,默认是MD5加密

8、建立本地项目控制文件

    touch /data/svn/auth

    我的文件内容为:

[groups]
[hms.rd.ikang.com:/]
#wxy = rw
chen.shanshan = rw
nuo = rw
jonathan.sun = rw

[php.ikang.com:/]
#wxy = rw
peter = rw

[tony.tang:/]
tony.tang = rw
jonathan.sun = rw
clay.li      =rw

9、安装客户端,访问服务器

    因为我的apache配置端口为88所以访问服务器的时候必须加上端口号。

    [url]http://192.168.7.10:88/svn/tony.tang[/url]

   注意:SVN是APACHE配置的时候加上去的。

10、到此安装基本结束

     修改一下/data/svn/repos属性,否则会导致文件上传失败。

    cd /data/svn/

     chmod -R apache.apache repos

主要参考文章:

[url]http://www.01cn.net/cgi-bin/topic_show.cgi?id=3073&bpg=1&age=0[/url]

在此对作者表示感谢!

Linux下安裝svn,cannot find -lexpat

在make的時候,出現如下問題

/usr/bin/ld: cannot find -lexpat

collect2: ld returned 1 exit status

make: *** [subversion/svn/svn] Error 1

應該是缺少-lexpat庫文件,

安裝安裝盤1、2張中的

expat-1.95.8-8.2.1.i386.rpm

expat-devel-1.95.8-8.2.1.i386.rpm

就可以了

安裝了之後,svn的make就過了

 

 

/usr/lib/libexpat.so: could not read symbols: File in wrong format

在编译 apr-util 和 subversion 都碰到过同样的问题,解决的办法是打开 Makefile 找到 -lexpat 这么一个参数,修改为: /usr/lib64/libexpat.la 即可。

其他64位版本的linux如果出现同样问题也可以参考此方法

或者:备份/usr/lib/目录下的libexpat*,然后拷贝/usr/lib64/目录下的libexpat*至/usr/lib/目录,注意其中的软连接,要保证与原来的一致,否则ldconfig检测时会报错误。

安装svn configure时报错:configure: error: subversion requires zlib

原因是缺少了zlib-devel    ,yum install  zlib-devel   之后就OK了

make:
在make的时候,出现错误
/usr/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
make: *** [subversion/svn/svn] Error 1
是缺少-lexpat 库文件,找安装盘中的
expat-x.x.x.x.rpm
expat-devel-x.x.x.x.rpm
rpm -ivh 安装上就可以了
或者  yum install expat 和 yum install expat-devel

应用:

创建版本库:  svnadmin create /dat/svn/repos


linux svn启动:svnserve -d -r /data/svn
vi  /data/svn/conf/svnserve.conf 修改:
# anon-access = read
# auth-access = write
#linden.guo add at 2008-10-31
anon-access = none
auth-access = write

# password-db = passwd
#linden.guo add at 2008-10-31
password-db = passwd

#linden.guo add at 2008-10-31
authz-db = authz

猜你喜欢

转载自rtxbc.iteye.com/blog/1100060