按照官方文档 http://subversion.apache.org/packages.html

使用apt-get安装方式:

1.安装Subversion:

sudo apt-get install subversion

2.安装libapavhe2-svn

sudo apt-get install libapache2-svn

提示: 
No apache MPM package installed

需要安装一个apache的mpm模块: 
sudo apt-get install apache2-mpm-* 
可供安装的模块有四种:

apache2-mpm-event	事件驱动的MPM
apache2-mpm-perchild 依赖worker,过渡
apache2-mpm-prefork 传统MPM(不使用线程)
apache2-mpm-worker 支持多线程和多进行混合模型的高速MPM

只需安装mpm-worker:

sudo apt-get install apache2-mpm-worker 
3.创建配置库根目录(该目录下存放多个配置库)和建库
mkdir /usr/svn_root
chmod -R 770 /usr/svn_root
svnadmin create /usr/svn_root/repo1
4.创建apache账户并赋值
sudo adduser apache
sudo chown -R apache:apache /usr/svn_root
5.配置dav_svn.conf:
sudo vi /etc/apache2/mods-available/dav_svn.conf
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
#
# NOTE: for a setup with multiple vhosts, you will want to do this
# configuration in /etc/apache2/sites-available/*, not here. # <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/
# Note, a literal /svn should NOT exist in your document root.
<Location /svn> # Uncomment this to enable the repository
DAV svn # Set this to the path to your repository
#SVNPath /var/lib/svn
# Alternatively, use SVNParentPath if you have multiple repositories under
# under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
# You need either SVNPath and SVNParentPath, but not both.
SVNParentPath /usr/svn_root # Access control is done at 3 levels: (1) Apache authentication, via
# any of several methods. A "Basic Auth" section is commented out
# below. (2) Apache <Limit> and <LimitExcept>, also commented out
# below. (3) mod_authz_svn is a svn-specific authorization module
# which offers fine-grained read/write access control for paths
# within a repository. (The first two layers are coarse-grained; you
# can only enable/disable access to an entire repository.) Note that
# mod_authz_svn is noticeably slower than the other two layers, so if
# you don't need the fine-grained control, don't configure it. # Basic Authentication is repository-wide. It is not secure unless
# you are using https. See the 'htpasswd' command to create and
# manage the password file - and the documentation for the
# 'auth_basic' and 'authn_file' modules, which you will need for this
# (enable them with 'a2enmod').
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd # To enable authorization via mod_authz_svn (enable that module separately):
<IfModule mod_authz_svn.c>
AuthzSVNAccessFile /etc/apache2/dav_svn.authz
</IfModule> # The following three lines allow anonymous read, but make
# committers authenticate themselves. It requires the 'authz_user'
# module (enable it with 'a2enmod').
#<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
#</LimitExcept> </Location>

6.增加svn用户,第一次增加需要加-c参数(创建新的dav_svn.passwd文件):

sudo htpasswd -c /etc/apache2/dav_svn.passwd wwl
New password:
Re-type new password:
Adding password for user wwl
sudo htpasswd /etc/apache2/dav_svn.passwd apache
sudo htpasswd /etc/apache2/dav_svn.passwd test1
sudo htpasswd /etc/apache2/dav_svn.passwd test2

7.设置svn库权限:

sudo vi /etc/apache2/dav_svn.authz
[groups]
admin = wwl
CM = apache
test = test1,test2 [/]
* =
@admin = rw
@CM = r [repo1:/]
* =
@CM = rw
@test = r [repo1:/branches]
@test = rw
[repo1:/trunk]
test2 = rw
[groups]代表组定义:“组名 = 用户1,用户2...”;

[repo1:/]代表repo1配置库,repo1是配置库名称;

[repo1:/trunk]代表repo1配置库下/trunk目录;

@ 符号,则表示这是个群组权限设置;

@ admin = rw代表admin 这个组的所有用户有读写权限

test2 = rw代表test2这个用户对trunk有读写权限

PS:注意svn的权限继承关系
8.修改apache启动用户为apache:
sudo vi /etc/apache2/envvars
export APACHE_RUN_USER=apache
export APACHE_RUN_GROUP=apache
9.授权svn.authz要加载mod_authz_svn.so 在目录 /etc/apache2/mods-enabled 下创建软链接到 ../mods-available/authz_svn.load:

cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/authz_svn.load
10.启动Apache:
sudo /etc/init.d/apache2 start

 * Usage: /etc/init.d/apache2 {start|stop|graceful-stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean|status}
11.上传文件后显示:
 
题外话:
采用这种方式安装后,svn支持 svn:// file:// 访问方式
配置好apache后支持http:// https://  方式访问
 
系统环境:Ubuntu13_64
目前apt-get方式安装的版本是:
svn --version
svn, version 1.7.5 (r1336830) apache2 -v
Server version: Apache/2.2.22 (Ubuntu)
 

Ubuntu apt-get方式安装Subversion的更多相关文章

  1. Ubuntu 源码方式安装Subversion

    使用到的安装包: apr-1.5.1.tar.gz apr-util-1.5.3.tar.gz pcre-8.35.tar.gz httpd-2.4.9.tar.bz2 subversion-1.8. ...

  2. Unbuntu18.04通过apt源方式安装mysql5.7.22

    Ubuntu18.04在今年4月底发布了,喜欢尝鲜的小伙伴肯定是第一时间就更新了系统版本,那么在Ubuntu18.04中怎么安装msyql5.7(mysql8.0因为新出,再观望一段时间)呢? * 带 ...

  3. ubuntu - 14.04,安装VirtualBox 5.0(虚拟机软件)!

    VirtualBox是一款免费.开源的虚拟机软件,可以运行在多种操作系统上,真的是一款值得我们使用的虚拟机软件! 官方网址:https://www.virtualbox.org/ ubuntu14.0 ...

  4. ubuntu采用apt方式安装多个版本php-fpm

    适用系统:Ubuntu 16.04 LTS / Ubuntu 14.04 LTS 安装 PHP Ondřej Surý 的 PHP PPA 为 Ubuntu 16.04/14.04 提供了 PHP7. ...

  5. Ubuntu下apt方式安装与更新Git

    本人使用的系统 Ubuntu 18.04.1 ,使用apt安装Git: sudo apt insatll git 安装后发现不是最新的版本,更新方法: sudo add-apt-repository ...

  6. ubuntu 18.04 通过联网方式安装wine

    ubuntu 18.04 通过联网方式安装wine 1.如果是64位机器,先开启允许32位架构程序运行 sudo dpkg --add-architecture i386 2.添加元wine源码安装仓 ...

  7. ubuntu 14.04 下利用apt-get方式安装opencv

    转载,请注明出处:http://blog.csdn.net/tina_ttl 目录(?)[+] 标签(空格分隔): Linux学习 OpenCV ubuntu 1404 下利用apt-get方式安装O ...

  8. [转]在ubuntu linux下以编译方式安装LAMP(apache mysql php)环境

    FROM : http://www.cnblogs.com/eleganthqy/archive/2010/02/28/1675217.html 最近转向到了使用ubuntu做桌面,安装好系统以来一直 ...

  9. 树莓派学习笔记——apt方式安装opencv

    0.前言     本文介绍怎样在树莓派中通过apt方式安装opencv.并通过一个简单的样例说明怎样使用opencv. 相比于源码方式安装opencv,通过apt方式安装过程步骤简单些,消耗的时间也少 ...

随机推荐

  1. 如何使用mysql存储树形关系

    最近遇到业务的一个类似文件系统的存储需求,对于如何在mysql中存储一颗树进行了一些讨论,分享一下,看看有没有更优的解决方案. 一.现有情况 首先,先假设有这么一颗树,一共9个节点,1是root节点, ...

  2. 了解 WMI (Windows Management Instrumentation) Windows管理工具

    它的功能主要是:访问本地主机的一些信息和服务,可以管理远程计算机(当然你必须要拥有足够的权限),比如:重启,关机,关闭进程,创建进程等

  3. 重温PHP之快速排序

    基本原理:选出当前数组中任一元素(通常为第一个)作为标准,新建两个空数组分别置于当前数组前后,然后遍历当前数组,如果数组中元素值小于等于第一个元素值就放到前边空数组,否则放到后边空数组. //快速排序 ...

  4. HDU 4714 Tree2cycle (树形DP)

    Tree2cycle Time Limit: 15000/8000 MS (Java/Others)    Memory Limit: 102400/102400 K (Java/Others)Tot ...

  5. vultr vs digitalocean vs linode

    vultr官方网站:www.vultr.comdigitalocean官方网站:www.digitalocean.comlinode官方网站:www.linode.com 一般来说我们买VPS的时候都 ...

  6. NAS(Network Attached Storage:网络附属存储)

    NAS(Network Attached Storage:网络附属存储)按字面简单说就是连接在网络上,具备资料存储功能的装置,因此也称为"网络存储器".它是一种专用数据存储服务器. ...

  7. mormot允许跨域访问

    mormot允许跨域访问 ctxt.OutCustomHeaders:='Access-Control-Allow-Origin:*' 允许跨域访问 其实其他HTTP控件要实现跨域访问,也是类似设置. ...

  8. 怎样在centos安装python-mysql?

    在python中使用mysql,须要安装mysql-python依赖包, 能够通过pip来安装: pip install MySQL-python 假设错误发生,须要先安装一个开发包: yum ins ...

  9. TreeMap源代码深入剖析

    第1部分 TreeMap介绍 A Red-Black tree based NavigableMap implementation. The map is sorted according to th ...

  10. iOS:删除、插入、移动单元格

    删除.插入.移动单元格的具体实例如下:   代码如下: #import "ViewController.h" #define NUM 20 typedef enum { delet ...