This is a cookbook for a SubVersion (aka svn) installation on debian and apache2 with LDAP integration authentication.

  1. Install subversion

    apt-get install subversion
    
  2. Configure subversion

    mkdir /var/lib/svn
    svnadmin create /var/lib/svn/repos
    chown www-data:www-data /var/lib/svn/repos/ -R
    
  3. Install Apache2

    apt-get install apache2
    
  4. Set apache2 modules

    apt-get install libapache-mod-ldap libapache-auth-ldap libapache2-svn
    

    If needed enable modules

    a2enmod ldap
    a2enmod auth_ldap
    
  5. Setup Apache2 website

    • Create folder

      mkdir /var/www/svnwebsite
      
    • Create website configuration file usually in /etc/apache2/sites-available

      NameVirtualHost svnserver.dev
      <VirtualHost svnserver.dev>
         ServerAdmin webmaster@localhost
      
      DocumentRoot /var/www/svnserver
      
      <Directory />
         Options Indexes FollowSymLinks MultiViews
         Order allow,deny
         allow from all
      
         ### LDAP AUTHENTICATION SPECIFICS
         # Do not check other data besides LDAP
         AuthLDAPAuthoritative on
         # Do basic password authentication in the clear
         AuthType Basic
         # The name of the protected area or "realm"
         AuthName "SVN"
         # AD requires an authenticating DN to access records
         AuthLDAPBindDN "cn=user,ou=Users,dc=domain
         # This is the password for the AuthLDAPBindDN user in AD
         AuthLDAPBindPassword "password"
         # The LDAP query URL
         AuthLDAPURL "ldap://ldapserver:389/ou=Users,dc=domain
         #authorization
         require valid-user
      </Directory>
      
      <Location /repos >
        DAV svn
        SVNParentPath /var/lib/svn/
        AuthzSVNAccessFile /etc/apache2/dav_svn.authz
      </Location>
      
    • Enable new website

      a2ensite svnserver
      
    • Reload new configuration

      /etc/init.d/apache2 reload
      

LINKS https://www.debian-administration.org/articles/374 https://cedar-solutions.com/JSPWiki/Wiki.jsp?page=SubversionApache2 https://gentoo-wiki.com/HOWTO_Apache2_with_subversion_SVN_and_DAV https://httpd.apache.org/docs/2.0/mod/mod_auth_ldap.html