linux 下面httpd支持的svn 服务器端安装

一,Subversion有两种运行方式

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

以下是基于httpd的svn的安装

二,安装svn

yum install  subversion mod_dav_svn

 

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]# vi 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
#
#   # 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的一些操作
check out操作
[root@svn www] cd /var/www
[root@svn www] svn co http://127.0.0.1/svn/test  /var/www/html

updatet操作
[root@svn www] cd /var/www
[root@svn www] svn update

edit和commit操作
[root@svn www] cd /var/www
[root@svn www] vi  test.txt -- 修改一些东西后.
[root@svn www] svn commit -m "Added a line to test.txt."
Sending        test/test.txt
Transmitting file data .
Committed revision 2.

add和delete操作
[root@svn www] cd /var/www
[root@svn www] vi 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就可以了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值