2. Getting started

To use SVN Access Manager you need at least:

  • a working subversion installation
  • a MySQL Database, version 4 or higher
  • an Apache web server, version 2.0 or higher with DAV, mod_authz and SVN support
  • PHP version 4 or higher

To top

2.1 Download the software

First download the source archive from sourceforge.net. SVN Access Manager is available as bzip2 and gzip compressed archive and as zip archive as well.

To top

2.2 Installation procedure

The installation is divided up in several parts. Just follow the instructions below.

For the installation description it is assumed that SVN Access Manager ist installed to /home/svnacessmanager, the web server is accessed as localhost and the Subversion Repository and the MySQL database are on the same host. The directory containing the repositories is assumed as /svn/repos. The files needed for authentication and authorization are assumed in /etc/svn.

To top

2.2.1 Install the software

Go to a directory where the software can be accessed by your Apache web server. Unpack the archive. For our example do the following:

# cd /home/svnaccessmanager
# tar -xvfz svnaccessmanager-0.3.0.0.tar.gz

Proceed with setting up the Apache web server described in the next step.

To top

2.2.2 Setup the Apache web server

2.2.2.1 General web server setup

Your Apache web server must know about the SVN Access Manager if it is not installed in the DocumentRoot of your web server. In the latter case you can include a line similar to this in your web server configuration:

Alias /svnaccessmanager /home/svnaccessmanager/svn_access_manager

To get user authentication and authorization work you have to add DAV support to your web server and configure it accordingly. You can use a configuration similar to this:

<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

The configuration above assumes that no anonymous access to the repository is allowed. If you need anonymous read access you have to limit the Require valid-user to write operations. See the Apache web server documentation for further information.

After adding this don't forget to reload your web server to make sure the configuration changes are active.

Btw. The settings above are printed out from the installer after a successful installation. The installer output is modifies according to your settings.

To top

2.2.2.2 ViewVC

If you plan to use ViewVC anyone who can access ViewVC can access all repositories storing data in the ViewVC database. SVN Access Manager is capable to create a ViewVC web server configuration to limit access. It will consist of a group file and a web server configuration file.

To use the ViewVC configuration files you have to configure

root_as_url_component = 1

in the viewvc.conf file of your ViewVC installation. Without this configuration setting the generated files will not work properly.

SVN Access Manager will create the group file for allowing access to the repositories stored in ViewVC. It will also create a configuration file for the Apache web server to use this group file. To use the Apache configuration file you have to advice your Apache web server to load the configuration file. You have to define a command for reloading the Abache web server configuration which can be executed by the web server itself.

Here's a short description of a setup using Apache web server 2.2 with Debian Etch. For the example it is assumed, that SVN Access Manager creates the configuration files to /etc/svn and ViewVC version 1.0.5 is already installed to /usr/local/viewvc-1.0.5. It is also assumed that you have configured Python accordingly. The ViewVC web server configuration consists of two files:

  • viewvc-apache.conf
  • viewvc-groups

For user authentication the password file created from SVN Access Manager ist used as well.

Example configuration:

First go to /etc/apache2/sites-available. Create a file "viewvc" containing the following:

ScriptAlias /viewvc /usr/local/viewvc-1.0.5/bin/cgi/viewvc.cgi

Go to /etc/apache2/sites-enabled and create a link to the file created before:

ln -s /etc/apache2/sites-available/viewvc viewvc

Now change to /etc/apache2/conf.d and create a link to the ViewVC configuration created bySVN Access Manager:

ln -s /etc/svn/viewvc-apache.conf viewvc-apache.conf

For automatic configuration reload of the web server you can define a sudu command like this:

www-data        ALL = NOPASSWD: /etc/init.d/apache2 graceful

Now restart your web server.

Detailed information about ViewVC can be found on the ViewVC Homepage and in the INSTALL file in the ViewVC archive.

To top

2.2.3 Setup a MySQL database and a database user

You need a database for SVN Access Manager and an user with full access to this database. To create the database do the following as root user of your MySQL database:

CREATE DATABASE svnadmin;

To create a user having access to this database do the following as root user of your MySQL database:

CREATE USER 'svnadmin'@ 'localhost' IDENTIFIED BY '*******';

GRANT USAGE ON * . * TO 'svnadmin'@ 'localhost' IDENTIFIED BY '*******'
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

GRANT ALL PRIVILEGES ON `svnadmin` . * TO 'svnadmin'@ 'localhost';

After finishing the database work continue with installing SVN Access Manager.

If you get an error "No database selected" during installation check if the database user has sufficient rights to access and to work with the database!

To top

2.2.4 Using the installer

Important notice:
Please remove the installer script after finishing the installation. It is a security risk to have the installer on a global accessible site! You can achieve this by removing the install.php script or by making it unaccessible for the user running the web server.

The installer ist started by entering the following URL into your web browser presuming that you have the alias names as mentioned above. Otherwise please use the values fitting your installation:

http(s)://localhost/svnaccessmanager/install/install.php

It is recommended to use https to access the installer over the internet because of the fact that passwords are sent to the web server!

After the installer is started, please fill in the values fitting your requirements. Below you find a short description of the several settings. After you finished filling the appropriate values click Start installation. If there are errors please correct them. Otherwise the installer starts and gives you a success information. Additional the web server configuration is printed out.

To top

2.2.4.1 Database settings

The installer can create the database tables during installation. You can select if you want to drop already existing tables or not. The database user must have sufficient rights to do this. Please make sure that the user has the rights to create and drop tables and create and drop indices.

To top

2.2.4.2 Administrator account

After a successful installation you need a user to administer SVN Access Manager. This user has all rights within SVN Access Manager. So be careful what password you use. By default the password must consist of lower case letters, upper case letters, digits and special characters. It must have 14 characters at least.

To top

2.2.4.3 Web server settings

In the web server section you can decide whether you want to use SVN access control and Apache user authentication. If you want to use the different restrictions you must specify the filenames where to store the generated files. Please keep in mind that the web server user must be able to write the files!

To use the ViewVC restrictions you must select to create the configuration files, specify the directory where to write the configuration files, enter the alias you use for ViewVC in the web server and give a command which enables the web server to restart itself. You can find detailed explanations about the setup of the ViewVC restrictions here. You can find information about ViewVC on the ViewVC Homepage.

SVN Access Manager makes use of the svn and the grep commands. Please check the installer's suggestions and correct them if necessary.

To top

2.2.4.4 Miscellaneous settings

In this section you can decide if you want to use JavaScript or not. JavaScript is needed to make the directory selections easier because you can select a directory the one click.

SVN Access Manager can do logging. Every action will be logged into a database table and a report will be available.

The Page size sets the default value of how many records will be displayed on a screen. This value can be overwritten by the preferences each user can set.

The password length fields set the minimal length for user and administrator passwords. It is strongly recommended to have strong and long enough passwords. Please keep in mind that a repository which has weak user and administrator passwords can easily be accessed by a malicious user.

You can use crypt or md5 to crypt the passwords. You can switch the configutation at every time by changing the setting in the config.inc.php file. The passwords are stored encrypted in the database. Once an user changes his password it will be encrypted with the new algorithm.

To top

2.3 First steps after installation

After a successful installation of SVN Access manager you should configure the application to your needs. That means that you create the necessary users and groups, define the repositories usable in projects and define the projects and its responsible persons.

To do this it is recommended to do the following steps:

  1. create the users you need
  2. create the groups you need and assign the users to the groups
  3. create the repository entries
  4. create the projects and assign responsible users to the projects