在装载mod_dav_svn.so前,必须先装载mod_dav.so模块。它由dav.load文件控制,内容如下:
[size=+0]LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
dav_svn.conf是mod_dav_svn.so模块的配置文件,内容如下:
# 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 /home/svn #设置版本存储库路径,仅支持单个储存库,该路径要可被Apache进程访问。
# 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 /data/subversion #如果subversion下有多个储存库,则用SVNParentPath
# 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 #启用Apache基础验证
AuthName "Subversion Repository" #设置验证框标题
AuthUserFile /etc/apache2/dav_svn.passwd #指定验证用户文件名
# To enable authorization via mod_authz_svn
# AuthzSVNAccessFile /etc/apache2/dav_svn.authz #启用目录级别授权,dav_svn.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> #允许匿名访问,不允许Commit,不能
与AuthzSVNAccessFile同时使用
Require valid-user
</LimitExcept>
</Location>