zoukankan      html  css  js  c++  java
  • linux centos 下面httpd支持的svn 服务器端安装

    http://blog.51yip.com/server/291.html

    一,Subversion有两种运行方式

    一种是基于Apache Http Server另外一种是Subversion Standalone Server

    以下是基于httpd的svn的安装

    二,安装svn

    yum install httpd httpd-devel subversion mod_dav_svn

    如果你已经装了apache了,不想装二个apache的话。你可以单独下个subversion来装一下就行了。

    注意一点的是,路径要正确:

    #./configure --with-apxs=/apache路径/bin/apxs --prefix=/usr/local/subversion
    --with-apr=/usr/local/apache2 --with-apr-util=/apache路径 --with-ssl --with-zlib
    --enable-maintainer-mode

    1),确定已经安装了svn模块:mod_dav_svn

    [root@svn zhangying]# cd /etc/httpd/modules/
    [root@svn modules]# ls |grep svn
    mod_authz_svn.so
    mod_dav_svn.so
    [root@svn modules]#

    2),看一下svn是否已安装成功

    [root@svn modules]# svn --version
    svn, version 1.4.2 (r22196)
    compiled Aug 10 2009, 18:00:04

    Copyright (C) 2000-2006 CollabNet.
    Subversion is open source software, see http://subversion.tigris.org/
    This product includes software developed by CollabNet (http://www.Collab.Net/).

    The following repository access (RA) modules are available:

    * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
    - handles 'http' scheme
    - handles 'https' scheme
    * ra_svn : Module for accessing a repository using the svn network protocol.
    - handles 'svn' scheme
    * ra_local : Module for accessing a repository on local disk.
    - handles 'file' scheme

    三,创建仓库,修改svn配置文件

    1),加载模块

    [root@svn conf.d]#cd /etc/httpd/conf.d

    [root@svn conf.d]# nano subversion.conf

    添加以下二行

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

    2),创建仓库,以及仓库目录的设置

    # mkdir -p /var/www/svn

    # cd /var/www/svn

    # svnadmin create test

    # chown -R apache.apache test

    # vi /etc/httpd/conf.d/subversion.conf

    <Location /svn>
    DAV svn
    #注意,下面的路径,子文件夹名不能和父文件名重复,不然就会出问题

    SVNParentPath /var/www/svn/repository
    #
    #   # Limit write permission to list of valid users.
    #   <LimitExcept GET PROPFIND OPTIONS REPORT>
    #      # Require SSL connection for password protection.
    #      # SSLRequireSSL
    #
    AuthType Basic
    AuthName "Subversion repository"
    AuthzSVNAccessFile /var/www/svn/repository/authz.conf
    AuthUserFile /var/www/svn/repository/authfile
    Require valid-user
    #   </LimitExcept>
    </Location>

    3),添加用户

    下面建立可访问用户文件

    # htpasswd -c /var/www/svn/repository/authfile 用户名

    要增加用户,则使用下面命令

    # htpasswd /var/www/svn/repository/authfile 用户名
    
    //第一次设置用户时使用-c表示新建一个用户文件。回车后输入用户密码,完成对用户的增加
    当你用页面访问svn时,apache要进行的密码确认
    
    
    
    4),权限分限
    # nano /var/www/svn/repository/authz.conf
     [test:/] //这表示,仓库test的根目录下的访问权限 
     zhangy = rw //test仓库zhangy用户具有读和写权限 
     hunk = r //test仓库hunk用户具有读权限 
     [/] //这个表示在所有仓库的根目录下 
     * = r //这个表示对所有的用户都具有读权限 
     #[groups] //这个表示群组设置 
     #svn1-developers = zhangy, hunk //这个表示某群组里的成员 
     #svn2-developers = zhangy
     #[svn1:/]
     #@svn1-developers = rw //如果在前面加上@符号,则表示这是个群组权限设置

    搞好之后重起apache

    # service httpd restart
    
    5),svn的一些操作
    a.import操作
    [root@svn www] svn import /var/www/zhangy/test/ file:///var/www/svn/repository/test -m "Initial repository test"
    Adding         /var/www/zhangy/test.txt
     Adding         /var/www/zhangy/test1.txt
    
    注意:
    1,file:///在这里是3个/,我开始导入时写成了二个,老是报错,我就很晕。
    2,在导入时,如果存在中文字符的文件名导入会停止报错
    
    b.check out操作
    [root@svn www] cd /var/www
    [root@svn www] svn co http://yoursvnserver/svn/test
    Authentication realm: &lt;http://yoursvnserver:80&gt; Subversion repositoryPassword for 'youruser':
    A    test/test.txt
    A    test/test1.txt
    Checked out revision 1.
    
    c.edit和commit操作
    [root@svn www] cd /var/www
    [root@svn www] nano test.txt -- 修改一些东西后.
    [root@svn www] svn commit -m "Added a line to test.txt."
    Sending        test/test.txt
    Transmitting file data .
    Committed revision 2.
    
    d.add和delete操作
    [root@svn www] svn co http://yoursvnserver/svn/test
    [root@svn www] cd /var/www
    [root@svn www] nano test2.txt -- 添加一个新文件.
    [me@mylappy ~] svn add test2.txt
    A         test2.txt
    
    [me@mylappy ~] svn commit -m "new one"
    Adding         test2.txt
    Transmitting file data .
    Committed revision 3.
    
    删除操作把add换成delete就可以了
    TortoiseSVN客户端,网上搜一下,到处都是,在这儿就不罗嗦

    参考文档
    http://wiki.centos.org/HowTos/Subversion?highlight=%28subversion%29

  • 相关阅读:
    在 Windows 上测试 Redis Cluster的集群填坑笔记
    vmware安装黑苹果教程
    微信支付v3发布到iis时的证书问题
    Linux下安装SQL Server 2016(连接篇SQL Server on linux)
    Linux下安装SQL Server 2016(连接篇SQL Server on linux)
    Linux下安装SQL Server 2016(安装篇SQL Server on linux)
    Linux下安装SQL Server 2016(准备篇SQL Server on linux)
    客服端与服务端APP支付宝支付接口联调的那些坑
    ASP.NET MVC]WebAPI应用支持HTTPS的经验总结
    .net平台下C#socket通信(中)
  • 原文地址:https://www.cnblogs.com/abcbuzhiming/p/2921304.html
Copyright © 2011-2022 走看看