User Tools

Site Tools


tutorials:redmine_svn_integration

Redmine and Subversion integration

System settings

  • Debian GNU/Linux 5.0 Lenny, Apache2, MySQL5, Redmine 0.8
    koala:~# cat /etc/issue
    Debian GNU/Linux 5.0 \n \l
    
    koala:~# uname -a
    Linux koala 2.6.26-1-openvz-amd64 #1 SMP Fri Mar 13 19:02:24 UTC 2009 x86_64 GNU/Linux
    
    koala:~# apache2 -v
    Server version: Apache/2.2.9 (Debian)
    Server built:   Jul 14 2009 20:44:04
    
    koala:/etc/apache2/sites-enabled# mysql --version
    mysql  Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2
    
    koala:/usr/local/lib/redmine-0.8# svn info
    Path: .
    URL: http://redmine.rubyforge.org/svn/branches/0.8-stable
  • Redmine installation folder is /usr/local/lib/redmine-0.8.

First steps

  • install required packages
    apt-get install libapache2-svn libapache-dbi-perl libapache2-mod-perl2 libdbd-mysql-perl libdigest-sha1-perl
  • enable Apache2 modules
    a2enmod dav
    a2enmod dav_svn
    a2enmod perl

Apache2 configuration

  • Perl module configuration
    koala:~# cd /usr/lib/perl5/Apache/
    koala:/usr/lib/perl5/Apache# ln -sf /usr/local/lib/redmine-0.8/extra/svn/Redmine.pm .
    • It's /usr/lib/perl5/Apache/, not /usr/lib/perl5/Apache2/
  • Add the following lines to the Apache2 site configuration file
    	PerlLoadModule Apache::Redmine
    	<Location /svn/redmine>
    		DAV svn
    		SVNParentPath "/var/svn/redmine" 
    
    		AuthType Basic
    		AuthName redmine
    		Require valid-user
    
    		PerlAccessHandler Apache::Authn::Redmine::access_handler
    		PerlAuthenHandler Apache::Authn::Redmine::authen_handler
    
    		## for mysql
    		RedmineDSN "DBI:mysql:database=databasename;host=my.db.server" 
    
    		RedmineDbUser "redmine" 
    		RedmineDbPass "password" 
    	</Location>

Replace databasename, my.db.server, "redmine" and "password" with valid data.

Git integration

Prepare

  • Enable dav_fs module
    a2enmod dav_fs
  • Register repositories in Apache2
    ./reposman.rb -s /var/git/redmine/ --owner www-data -r http://koala.cs.pub.ro/redmine -u http://koala.cs.pub.ro/git/redmine --scm git -f
  • Add the following lines to the Apache2 site configuration file
    	Alias /git/redmine	/var/git/redmine/
    	<Location /git/redmine>
    		DAV on
    
    		AuthType Basic
    		AuthName git-redmine
    		Require valid-user
    
    		PerlAccessHandler Apache::Authn::Redmine::access_handler
    		PerlAuthenHandler Apache::Authn::Redmine::authen_handler
    
    		## for mysql
    		RedmineDSN "DBI:mysql:database=koala_redmine;host=localhost"
    
    		RedmineDbUser "koala_redmine"
    		RedmineDbPass "ohnameotae"
    	</Location>
tutorials/redmine_svn_integration.txt · Last modified: 2009/10/26 14:32 by razvan