Setup the Apache Web Server

Add DAV support and configure authentication so Subversion clients can talk to your repositories.

General web server setup

Your Apache web server must know about SVN Access Manager if it is not installed in the DocumentRoot. In that case, add a line similar to this to your web server configuration:

Alias /svnaccessmanager /usr/share/svn-access-manager/svn_access_manager

To get user authentication and authorization working you need to add DAV support and configure it accordingly:

<Location /svn/repos>

  DAV svn

  SVNParentPath /svn/repos

  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/svn/svn-passwd
  AuthzSVNAccessFile /etc/svn/svn-access
  Require valid-user

  SVNIndexXSLT /svnstyle/svnindex.xsl

</Location>

CustomLog /var/log/apache2/svn.log "%t %u %{SVN-ACTION}e" env=SVN-ACTION

This configuration assumes no anonymous access to the repository is allowed. If you need anonymous read access, limit Require valid-user to write operations — see the Apache documentation for details.

Tip

These settings are also printed out by the installer after a successful installation, adapted to your input. Don’t forget to reload your web server after making changes.

Optional: LDAP authentication

If you plan to use LDAP authentication, a configuration similar to this can be used:

LDAPSharedCacheSize 200000
LDAPCacheEntries 1024
LDAPCacheTTL 600
LDAPOpCacheEntries 1024
LDAPOpCacheTTL 600

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

Alias /svnstyle /usr/share/doc/subversion-1.4.2/tools/xslt/

<Location /svn/repos>
        DAV svn
        SVNParentPath /svn/repos

        SSLRequireSSL
        AllowOverride               ALL
        Satisfy                     All
        AuthType                    Basic
        AuthBasicProvider           ldap
        AuthName                    "SVN LDAP Auth Test"
        AuthLDAPURL                 "ldap://127.0.0.1:389/ou=people,ou=example?uid?sub?(objectclass=*)"
        AuthLDAPBindDN              ou=apache,ou=example
        AuthLDAPBindPassword        password
        AuthLDAPGroupAttribute      member
        AuthLDAPGroupAttributeIsDN  on
        AuthzLDAPAuthoritative      off
        AuthLDAPCompareDNOnServer   On
        Require valid-user

        AuthzSVNAccessFile /etc/svn/svn-access

        SVNIndexXSLT /svnstyle/svnindex.xsl

LogFormat "%t %u %{SVN-ACTION}e" svn_common
CustomLog svn_common env=SVN-ACTION

Continue: Using ViewVC