Ubuntu下 apache + svn 配置初探(完善中,仅供参考)

新建SVN代码库和用户


参考

Ubuntu SubVersion

Ubuntu下SVN+Apache版本管理服务器配置

Ubuntu 9.04 Server Apache + SVN 的搭建笔记

Version Control with Subversion

(待完善)



Apache配置

示例:/etc/apache2/mods-available/dav_svn.conf 

若个以下条目,对应一个或多个SVN代码库

<Location /DemoFolder/DemoSVNProject>


  # Uncomment this to enable the repository
  DAV svn


  # Set this to the path to your repository
  SVNPath /usr/local/svn_repository/DemoFolder/DemoSVNProject
  # 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/local/svn_repository /DemoFolder/


  # 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 "Repository"
  AuthUserFile /etc/subversion/passwd


  # To enable authorization via mod_authz_svn

  #配置对应的SVN鉴权文件,位于SVN代码库目录下
  AuthzSVNAccessFile /usr/local/svn_repository/DemoFolder/DemoSVNProject/conf/authz


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


SVN鉴权文件

示例:/usr/local/svn_repository/DemoFolder/DemoSVNProject/conf/authz


### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').


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


[groups]
# usr1_and_user2 = user1,user2
# usr1_user2_and_joe =usr1,user2,&joe
develop_app = app_user3,app_user4
develop_sys = sys_user3,sys_user3


# [/foo/bar]

# user 1拥有rw权限,别名joe拥有r权限,其他用户无权限
# user1 = rw 
# &joe = r
# * =


# [repository:/baz/fuz]
# user 2拥有rw权限,其他用户拥有r权限
# @usr1_and_user2 = rw
# * = r

#自定义的权限
[DemoSVNProject:/]
@develop_app = rw
@develop_sys = rw
[DemoSVNProject:/trunk]
@develop_app = rw
@develop_sys = rw
[DemoSVNProject:/branches/branch_demo/]
@develop_app = rw
@develop_sys = rw

##指定用户权限时不需加前缀,指定别名权限时别名前加&,指定组权限时组名前加@

##对子目录的操作权限自动继承自父目录。

[Demo1:/]
simba = rw
neptune = r
gooo = r
* = 
[Demo1:/dd]
cs = rw
gooo =         #取消gooo对Demo1/dd目录的访问权限。若不加此行,gooo可访问Demo1/dd目录,他继承自其父目录。
[Demo1:/dd/d2]
gooo = rw    #使得gooo可访问Demo1/dd/d2,即使gooo不能访问Demo1/dd
cs = rw

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值