Skip navigation.
Home
l'art pour l'art

remote subversion server

When using Subversion on a remote server it is recommended to use it along with an Apache so Apaches sophisticated user management can be used. There is a special Subversion module for Apache.

In case you are compiling subversion on you own, you will need to pass the --with-apxs and --with-apr options to Subversion's configure script.

The Apache configuration file needs the following entries:

Modules

# authentication by password file
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_host_module modules/mod_authz_host.so
# 'Require user' directive
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so

# SSL for encrypted passwords and trustworthy source download
LoadModule ssl_module modules/mod_ssl.so

# SVN and its required DAV support
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module  modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

HTTPS

DocumentRoot /var/https/svn

# assume all sources are UTF-8 encoded (only required when browsing the
# repository with a web browser)
AddDefaultCharset utf-8

# activate HTTPS
Listen 443
SSLCertificateFile    /etc/apache2/certificate.pem 
SSLCertificateKeyFile /etc/apache2/privatekey.pem
SSLEngine             on
# only use TLSv1 for maximum security
SSLProtocol           -all +TLSv1

Repository

# publish /var/svn/foobar as https://foobar/
<Location /foobar>
  DAV svn
  # path to the Subversion repository
  SVNPath /var/svn/foobar
       
  Order allow,deny
  Allow from all  

  # require HTTP Authentication for write access
  AuthType Basic
  AuthName "Foobar Subversion Repository"
  AuthUserFile /var/svn/passwd 

  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  </LimitExcept>
</Location>