Posted by: Rick Cordeiro | February 1, 2007

Subversion SVN with Apache2 and DAV

  • apt-get install subversion libapache2-svn

The projects are going to be hosted on /var/svn/repository. We need to create to directories and give full permission to the apache user:

  • mkdir /var/svn mkdir /var/svn/repository

Now that the directory exist, we need to give write access to the apache user:

  • chown www-data:www-data -R /var/svn/repository
  • chmod 770 -R /var/svn/repository

Configuring Apache:

Now, we need to modify apache svn module configuration file, edit /etc/apache2/mods-available/dav_svn.conf and make sure the following argument are properly setted up:

.. SVNParentPath /var/svn/repository

#SVNPath /var/svn/repository

…. AuthType Basic

AuthName “Subversion Repository”

AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user

..In order to be able to track who modify the different files of the project, we need to create users. Create the first user (tester) and supply a password:

  • htpasswd2 -c /etc/apache2/dav_svn.passwd tester

Creating a first repository:

Get apache user access (so files and directories are created with proper rights:

  • su www-data

and create your first repository (example):

  • svnadmin create /var/svn/repository/example

import your project:

  • svn import /path/to/projectexample file:///var/svn/repository/example/examplev1 -m”initial import”

Now, get back to root user (Ctrl-D) and restart apache:

  • /etc/init.d/apache2 restart

Dont forget you can only access the repository through http://domain/svn/example, http://domain/svn will lock you out even after authenticated


Leave a response

You must be logged in to post a comment.

Categories