转载请注明出处 http://blog.csdn.net/sunxinrui1983/archive/2009/09/15/4554694.aspx

一、需要安装数据包

#yum install apr

#yum install mod_dav_svn

二、配置apache服务器

配置apache服务器,使其加载subversion模块。

在/etc/httpd/conf.d/下看看能否找到subversion.conf,如果没有,按照下面内容建立该文件

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
#LoadModule dav_module modules/mod_dav.so

#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn".  Each repository
# must be both:
#
#   a) readable and writable by the 'apache' user, and
#
#   b) labelled with the 'http_sys_content_rw_t' context if using
#   SELinux
#

#
# To create a new repository "http://localhost/repos/stuff" using
# this configuration, run as root:
#
#   # cd /var/www/svn
#   # svnadmin create stuff  
#   # chown -R apache.apache stuff
#   # chcon -R -t -t http_sys_content_rw_t stuff
#

<Location /repos>
     DAV svn
     SVNParentPath /public/svn/
#
#   # Limit write permission to list of valid users.
#   <LimitExcept GET PROPFIND OPTIONS REPORT>
#      # Require SSL connection for password protection.
#      # SSLRequireSSL
#
      AuthzSVNAccessFile /etc/httpd/authz.conf
      AuthType Basic
      AuthName "Please enter your name and password"
      AuthUserFile /etc/httpd/conf.d/authfile
      Require valid-user
#   </LimitExcept>
</Location>

其中:

SVNParentPath指明svn数据库的路径,如果有多个项目,则指向多个项目的父目录,用户可以通过http://ip_addr/repos/project_1来访问。

AuthUserFile指明http访问用户名,密码验证文件路径,如果不设置用户名,密码则该部分可以注释掉。添加用户用如下命令:

htpasswd -c /etc/httpd/conf.d/authfile sxr

-c表示创建,以后添加则不需此参数。

AuthzSVNAccessFile 指明详细权限设置文件路径,该文件可以进一步指明不同项目的访问权限,该文件的格式如下(需要注意每行前面不能有空格 ):

[groups]
sxr = sxr
stb_sxr = stb_sxr

[AR6k:/]
sxr = rw

[linux-2.6.30:/]
stb_sxr = rw

三、重新启动apache服务

#apachectl restart

附录:设置subversion库

用如下命令创建subversion管理库

#mkdir /public/svn/AR6k

#svnadmin create /public/svn/AR6k

参考如下内容编辑配置文件

#cat /public/svn/AR6k/conf/svnserve.conf

### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository

导入工程文件

#svn import AR6k files:///public/svn/AR6k -m "original"

如果想直接使用subversion提供的简单服务器,可以参考示例配置以下两个文件

#vi /public/svn/AR6k/conf/authz

### This file is an example authorization file for svnserve.

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
sxr = sxr
cvs = cvsroot

[repository:/public/svn/AR6k]
 @sxr = rw
# @harry_and_sally = rw
# * = r
[AR6k:/]
@sxr = rw
@cvs = rw

其中@sxr表示sxr组

#vi /public/svn/AR6k/conf/passwd

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret
sxr = sxr
cvsroot = cvsroot

启动subversion服务器

#svnserve -d -r /public/svn/

然后就可以通过svn://ip_addr/AR6k 来访问代码库。

Fedora 11 上安装subversion 和apache服务器相关推荐

  1. 如何在 Windows 11 上安装 RSAT 远程服务器管理工​​具

    如何在 Windows 11 上安装 RSAT 远程服务器管理工​​具 问题描述 与以前版本的 Windows 操作系统相比,此在 Windows 11 上安装远程服务器管理工​​具 (RSAT) 的 ...

  2. 在Fedora 11中安装Apache2+PHP5+MySQL(LAMP)

    在Fedora 11中安装Apache2+PHP5+MySQL(LAMP) LAMP是Linux, Apache, MySQL, PHP的缩写.这篇教程将教你如何在一台Fedora 11服务器上安装A ...

  3. 云服务器(uCloud)部署java web项目(二) 安装,配置apache服务器

    自己组建了一个网站,想要发布到互联网上.然后我就找到了这个链接 https://www.codecasts.com/series/deploy-a-website-from-scratch(是一个从零 ...

  4. 64位 Fedora 11 硬盘安装 配置全解

    64位 Fedora 11 硬盘安装 配置全解 转贴: http://www.ubuntuchina.com/viewthread.php?tid=7428&extra=page%3D1 硬盘 ...

  5. linux ubuntu 安装git服务器,[linux] Ubuntu20.04上安装搭建私有Git服务器Gitea

    [linux] Ubuntu20.04上安装搭建私有Git服务器Gitea [linux] Ubuntu20.04上安装搭建私有Git服务器Gitea Gitea 是相比于gitlab更加轻量化,而且 ...

  6. 如何在 FreeBSD 10.2 上安装 Nginx 作为 Apache 的反向代理

    如何在 FreeBSD 10.2 上安装 Nginx 作为 Apache 的反向代理 Nginx 是一款自由开源的 HTTP 和反向代理服务器,也可以用作 POP3/IMAP 的邮件代理服务器.Ngi ...

  7. macos 安装scala_如何在MacOS上安装Scala和Apache Spark

    macos 安装scala by Jose Marcial Portilla 通过何塞·马西尔·波蒂利亚(Jose Marcial Portilla) 如何在MacOS上安装Scala和Apache ...

  8. 在CentOS 8上安装与配置Apache虚拟主机

    实验环境 操作系统:Centos 8 web应用:apache 内网IP:192.168.3.21 shell执行:root 以root或具有sudo权限的用户身份登录执行如下操作. 主配置文件路径: ...

  9. 如何在服务器上安装虚拟机呢?服务器虚拟机安装教程

    如何在服务器上安装虚拟机呢?服务器虚拟机安装教程 虚拟机(Virtual Machine)指通过软件模拟的具有完整硬件系统功能的.运行在一个完全隔离环境中的完整计算机系统.在实体计算机中能够完成的工作 ...

最新文章

  1. 分析智能卡的ATR格式【转】
  2. 使用Struts2防止表单重复提交
  3. Docker说了这么多 最全的一篇在这里
  4. Xgboost简易入门教程
  5. 单调有界数列一定有极限
  6. 区块链BaaS云服务(11)招商银行ABS区块链平台
  7. Android之drawable state各个属性详解
  8. when is completed field filled in the backend
  9. 人人都可做 AI 开发者,云知声 AI 开放平台重磅上线
  10. bat脚本 -- 初步接触
  11. 十大算法 — 插入排序法【C语言代码诠释】
  12. [Matlab]变量,变量名与字符串的互相转换
  13. 好程序员大数据入门学习之Hadoop技术优缺点 1
  14. 奇迹s6ep3服务器修改技术,奇迹S6EP3服务端之让天鹰及装备不掉持久的
  15. 同济大学计算机专业考研的教材,同济大学电子信息(计算机与智能技术)专业考研参考书目-指定教材-辅导资料...
  16. 解决openwrt package目录下多个文件夹重名编译警告(call subdir 函数)
  17. pynq 环境搭建_FPGA硬件加速的图像大小调整案例分析
  18. 天地波超视距雷达在远洋无人航运中的运用
  19. Python 获取当前时间 年-月-日-时-分-秒
  20. 使用NanoHttpd在Android上实现HttpServer

热门文章

  1. 中年职场危机,这是我看过最靠谱的建议
  2. 实战:Nginx集成Lua脚本并调用memcached
  3. vue-cli-service 不是内部或者外部命令的解决办法(用了你就知道了)
  4. Java 洛谷 P2141 珠心算测验
  5. linux 本地做yum源,linux——制作本地yum源
  6. spark sql 本地调试_干货 | 如何成为大数据Spark高手
  7. 数据中心暖通相关知识与空调规划设计知识
  8. Html画布w3c,HTML canvas 标签
  9. 野火 stm32f429 pcb_PCB板价格是如何核算的
  10. DataScience:风控场景之金融评分卡模型的简介、构建(逻辑回归)开发(转评分卡)、使用过程(线上实现)之详细攻略