Subversion setup with apache

Setting up an apache based subversion needs a little more work then doing it with a plain or svnserve setup.

My steps are described here and executed on two computers.

Create your repository

# the switch --fs-type fsfs is the default
# but I was a little worried of getting the bdb file system
svnadmin create --fs-type fsfs demo

Make sure apache is capable of reading the repo and other cannot

# /var/lib/svn is owned by root so let www-data (apache) access the repos dir.
chmod o+rx /var/lib/svn
chmod -R o-rwx demo
chown -R www-data:www-data demo

Next create your authorization file by adding users with MD5 passwords

htpasswd -mc /etc/svn-auth-file clemens
htpasswd -m /etc/svn-auth-file test

Install and configure the modules needed for apache. On ubuntu the modules are enabled automatically.

apt-get libapache2-svn
# a2enmod dav_svn dav

Next make a svn repository available through the web

<VirtualHost svn.build2be.com:80>
  ServerAdmin webmaster@nowhere.abc

  <Location /repos>
    DAV svn
    SVNPath /var/lib/svn/apache
    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile /etc/svn-auth-file
    Require valid-user
  </Location>

ErrorLog /home/demo/log/svn_error.log

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

  CustomLog /home/demo/log/svn_access.log combined
  ServerSignature On
</VirtualHost>

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.