docker 使用docker镜像搭建svn+Apache环境

https://my.oschina.net/u/2006667/blog/637882

1,安装 apache ,svnapt-get install apache2 subversion libapache2-svn

不安装apache  是不能通过http方式来访问的.

subversion服务器是不需要apache的,但是可以使用apache,视具体情况来选择。
        1、如果只要通过file://或svn://来访问,则不需要apache,只安装svn即可,使用svnserve来作为服务。
        2、如果你要建立一个可以通过http://或https://来访问的版本库服务器,则你需要使用apache。

2,版本信息.

root# svn --version
svn, version 1.6.17 (r1128011)
compiled Dec 20 2014, 19:48:25

root#apachectl -v

Server version: Apache/2.2.22 (Debian)
Server built: Dec 23 2014 22:48:32

3,创建版本库并将所有权转让给apache2

svnadmin create  /disk1/d1/svn/project

chown www-data:www-data -R  /disk1/d1/svn/project

4,修改 /etc/apache2/mods-enabled/dav_svn.conf

实际上是软件连接:

root@iZ233or8cn2Z:/etc/apache2/mods-enabled# ls -l

lrwxrwxrwx 1 root root 30 Jul 2 17:05 dav_svn.conf -> ../mods-available/dav_svn.conf

对应了 /mods-available/dav_svn.conf  这个文件.

打开这个文件可见内容.网上很多版本的dav_svn.conf已经不是最新的版本了.

root@iZ233or8cn2Z:/etc/apache2/mods-enabled# cat 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
#SVNParentPath /disk1/d1/svn/project
# 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 /disk1/d1/svn # 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>

5,修改svn权限设置,权限主体可为个人或小组,以目录为节点设置读/写位,下面是样例:

/etc/apache2/dav_svn.authz
目录结构
svn---
+++++++project
++++++++++++++Client
++++++++++++++++++++test1
++++++++++++++Document
[groups]
admin = test1,test2
group_a =test3

[svn:/]
*=
[project:/]
*=

@admin =rw


[project:/Client]
*=

@group_a=rw

@admin=rw
[project:/Client/test1]
*=
test1=rw
[project:/Document]
*=
test2=rw

 

*=空 是没有权限 ,

r 读取

w写入 权限

6. 创建账户

#/etc/apache2

//首次加 -c
htpasswd -c dav_svn.passwd test
//
htpasswd dav_svn.test2

重置密码:

root@iZ233or8cn2Z:/etc/apache2# htpasswd --help
Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force MD5 encryption of the password (default). # -m 重置密码
-d Force CRYPT encryption of the password.
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for it.
-D Delete the specified user.
On other systems than Windows, NetWare and TPF the '-p' flag will probably not work.
The SHA algorithm does not use a salt and is less secure than the MD5 algorithm. #

htpasswd -m dav_svn.passwd liutxxx


7,重启apache生效

root@iZ233or8cn2Z:/etc/apache2# service apache2 restart
Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 10.175.197.65 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 10.175.197.65 for ServerName
.

8,访问.

去网页打开 http://127.0.0.1/svn/project/Document/

发现所有用户都能访问,权限不生效.

一度怀疑:

1,权限文件路径是否正确

2,权限文件 dav_svn.authz 是否chmod 777 dav_svn.authz

3,重点...

老版本是报 "apache报非法指令'AuthzSVNAccessFile' " 但新版本没有报错,却原因一样.

重启apache报非法指令'AuthzSVNAccessFile',那么很可能是'authz_svn_module'没加载或apache自己加载顺序的问题,可以在 mods-available/dav.load手动加载该模块解决问题。(添加下文中的最后一行即可)

参考网址:http://www.cnblogs.com/liuyangnuts/archive/2013/03/19/2965256.html

# file: /etc/apache2/mods-available/dav.load

LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so

新版本 不会报AuthzSVNAccessFile 只会没有权限,这点恶心了我一天.

重启apache : service apache2 restart

再去网页看看,能正确验证权限.

至此 svn 的搭建完成了.

debian 安装svn apache 小记. AuthzSVNAccessFile 不生效问题.的更多相关文章

  1. centos7基于SVN+Apache+IF.svnadmin实现SVN的web管理

    一.介绍 本文介绍的是CentOS7上搭建基于Apache.SVN Server.iF.svnadmin实现web后台可视化管理SVN. iF.SVNAdmin应用程序是Subversion授权文件基 ...

  2. CentOS7编译安装SVN(subversion1.9.7)

    参考连接0:http://www.programering.com/a/MDMzYDMwATg.html参考连接1:http://www.zsythink.net/archives/13180.系统信 ...

  3. Linux-yum在线安装svn步骤

    yum -y install subversion httpd mod_dav_svn 使用yum命令安装svn(subversion),httpd(apache服务器)和svn在apache上的插件 ...

  4. 1.svn+apache整合

    1:安装svn客户端, 并且在客户端下,能建立仓库,在自己的硬盘上,建一个库利用 file:///D:/xx/yy来管理自己的仓库. 2:把svn与apache整合. 2.1为什么与apache一起整 ...

  5. 170428、centos6.5安装Subversion + Apache +Jsvnadmin

    服务器地址:192.168.0.112 root用户操作 建议 安装前 更 新操作系统 # yum update 更新完成后重启 # reboot 安装 装 apache # yum install ...

  6. Centos5.8 安装SVN并配置HTTP访问

    安装 svn sudo yum install subversion 测试 svn --version 安装 httpd 的 svn 模块 sudo yum install mod_dav_svn 前 ...

  7. linux安装SVN

    1. 下载软件包 http://archive.apache.org/dist/subversion/ http://archive.apache.org/dist/subversion/subver ...

  8. linux 安装SVN

    1.环境centos6.4 2.安装svnyum -y install subversion 3.配置 建立版本库目录mkdir /www/svndata svnserve -d -r /www/sv ...

  9. ubuntu安装svn manager

    环境:系统ubuntu14.04 0. 更新软件库 sudo apt-get update sudo apt-get upgrade -y 1. 安装apache,svn,svn的apache模块 s ...

随机推荐

  1. mac系统小记

    1.设置 ls  命令结果的颜色 默认的 ls 是没有颜色的,可以通过设置 CLICOLOR 和 LSCOLORS 两个环境变量来实现.其中,CLICOLOR 是用来设置是否进行颜色的显示(CLI: ...

  2. mysql 存储引擎

    什么是MySql数据库 通常意义上,数据库也就是数据的集合,具体到计算机上数据库可以是存储器上一些文件的集合或者一些内存数据的集合.    我们通常说的MySql数据库,sql server数据库等等 ...

  3. DTD总结

    DTD 可以检测 XNM 文档的结构是否正确,就好像文章中用来保证结构正确的语法规则一样. 引入 DTD 1.引入私有的 DTD 文件,URI 可以使相对地址或绝对地址 <!DOCTYPE 根元 ...

  4. .htaccess 基础教程(三)RewriteCond标志符,RewriteRule适用的标志符

    1.利用 .htaccess 防止盗链 如果不喜欢别人在他们的网页上链接自己的图片.文档的话,也可以通过htaccess的指令来做到.当然这样也可以对你的网站服务器压力变小! 这次先给出‘代码’,然后 ...

  5. 最近使用oracle的笔记和少量的正则表达式

    用户.表空间.表:    一个用户一般给予一个表空间,可以多个用户共同管理一个表空间    一个表空间会有多张表对于权限的控制:    在数据库中在人员菜单与需要浏览的文件之间做权限设置能否浏览,可以 ...

  6. Java 中的内存泄露

    1.当你完成对流的读写时,应该通过调同close方法来关闭它,这个调用会释放掉十分有限的系统资源,否则,如果一个应用程序打开了过多的流而没有关闭,那么系统资源将被耗尽.

  7. ubuntu和centos安装RRDTool——cacti前置技能

    Installing Pre-Requisites Note that RRDTool 1.0.x versions included all dependancies, but 1.2.x vers ...

  8. Python正则表达式详解

    我用双手成就你的梦想 python正则表达式 ^ 匹配开始 $ 匹配行尾 . 匹配出换行符以外的任何单个字符,使用-m选项允许其匹配换行符也是如此 [...] 匹配括号内任何当个字符(也有或的意思) ...

  9. 创建 WPF 工具箱控件

    创建 WPF 工具箱控件 WPF (Windows Presentation Framework) 工具箱控件模板允许您创建 WPF 控件,会自动添加到 工具箱 安装扩展的安装. 本主题演示如何使用模 ...

  10. jQuery插件写法总结以及面向对象方式写法总结

    前两个是jQuery插件,后面2个是以对象的形式开发,都类似. 写法一 (function($, window){ // 初始态定义 var _oDialogCollections = {}; // ...