httpd svn 编译安装_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

DAV svn

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

SVNParentPath /var/www/svn/repository

#

#   # Limit write permission to list of valid users.

#  

#      # 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

#  

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: <http://yoursvnserver:80> 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客户端,网上搜一下,到处都是,在这儿就不罗嗦

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值