Project

General

Profile

Redmine svn integration

Added by Jevgen Gyrynovych almost 14 years ago

I've been faced with such a problem:

Installed Redmine, configured automatic repository svn creation for new
projects.
Users of redmine and svn must be created and matched automaticly. Found a
manual [[http://www.redmine.org/wiki/1/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl]]
But, whle adding necessary options in config of virtual host, apache showed
me an error message: "Invalid command
'RedmineDSN', perhaps misspelled or defined by a module not included in the
server configuration". As i understand such a problem shows up when symlink
for Redmine.pm is not created, but i did it
(/usr/lib/perl5/Apache/Redmine.pm)

If anyone knows how to solve this problem - i'd be very thankful.
OS: Ubuntu 10.04 Server


Replies (10)

RE: Redmine svn integration - Added by Felix Schäfer almost 14 years ago

Do you have mod_perl installed and configured in your apache config? Does apache successfully load the module? Have you installed the necessary perl modules for Redmine.pm?

RE: Redmine svn integration - Added by Jevgen Gyrynovych almost 14 years ago

Yes, I installed and configured libapache2-mod-perl2.
$ a2enmod perl
Module perl already enabled
And I installed all required packages with was specified in the documentation.

RE: Redmine svn integration - Added by Felix Schäfer almost 14 years ago

Jeka unnamed wrote:

"Invalid command
'RedmineDSN', perhaps misspelled or defined by a module not included in the
server configuration".

That means Apache doesn't know what RedmineDSN means, which is described in the Redmine.pm module, hence your Redmine.pm isn't loaded correctly, either because it's in the wrong location, or it has the wrong permissions, or whatever else.

RE: Redmine svn integration - Added by Jevgen Gyrynovych almost 14 years ago

ls l /usr/lib/perl5/Apache/Redmine.pm
lrwxrwxrwx 1 root root 39 2010-06-01 17:11 /usr/lib/perl5/Apache/Redmine.pm -> /usr/share/redmine/extra/svn/Redmine.pm
ls -l /usr/share/redmine/extra/svn/Redmine.pm
-rw-r--r-
1 root root 10064 2010-02-28 12:28 /usr/share/redmine/extra/svn/Redmine.pm
Maybe symlink must locate in other place? In documentation specified /usr/lib/perl5/Apache/Redmine.pm. How I can know correct path?

RE: Redmine svn integration - Added by Felix Schäfer almost 14 years ago

I don't know about the structure for Ubuntu, sorry. You have to look at where the other perl stuff lies in your system. On my gentoo system, it's /usr/lib64/perl5/vendor_perl/5.8.8/Apache/, when searching for Apache.pm, I also have:

/usr/lib64/perl5/vendor_perl/5.8.8/Authen/Simple/Apache.pm
/usr/lib64/perl5/vendor_perl/5.8.8/CGI/Apache.pm

Maybe that will help you. The symlink and file permissions aren't all either, you might have a directory "on the way" to the Redmine.pm that might not be accessible for apache.

RE: Redmine svn integration - Added by Pieter Smith almost 14 years ago

I have it working properly on Ubuntu Server 10.04LTS.
Some observations:
  1. If you're using Apache server 2.2, your symlink is in the right directory (/usr/lib/perl5/Apache/Redmine.pm)
  2. Check whether the symlink is broken (If broken it shows up red instead of cyan):
    ls -l --color=auto /usr/lib/perl5/Apache
      ...
      lrwxrwxrwx ... Redmine.pm -> /usr/share/redmine/extra/svn/Redmine.pm
      ...
    
  3. Check whether the the user www-data is able to read Redmine.pm
    sudo -u www-data cat /usr/share/redmine/extra/svn/Redmine.pm
      package Apache::Authn::Redmine;
      ...
      sub RedmineDSN {
      ...
      1;
    

RE: Redmine svn integration - Added by Jevgen Gyrynovych almost 14 years ago

I moved svn configuration to /etc/apach2/conf.d and apache started with this configuration. But I can't login in repository. User and password are correct, user has permission to project.

apache config:
@ # /svn location for users
PerlLoadModule Apache::Redmine
<Location /svn>
DAV svn
SVNParentPath "/var/lib/svn/"
Order deny,allow
Deny from all
Satisfy any

PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
AuthType Basic
AuthName "Redmine SVN Repository"
#read-only access
<Limit GET PROPFIND OPTIONS REPORT>
Require valid-user
Allow from all
Satisfy any
</Limit>
  1. write access
    <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
    </LimitExcept>
  1. for mysql
    RedmineDSN "DBI:mysql:database=redmine_default;host=localhost"
RedmineDbUser "user" 
RedmineDbPass "password"
&lt;/Location&gt;

mysql log
@100608 16:48:10 10789 Connect redmine@localhost on redmine_default
10789 Query set autocommit=1
10789 Query SELECT is_public FROM projects WHERE projects.identifier = 'ggg'
10789 Quit
10790 Connect redmine@localhost on redmine_default
10790 Query set autocommit=1
10790 Query SELECT hashed_password, auth_source_id, permissions FROM members, projects, users, roles, member_roles WHERE projects.id=members.project_id AND member_roles.member_id=members.id AND users.id=members.user_id AND roles.id=member_roles.role_id AND users.status=1 AND login='svntest' AND identifier='ggg'
10790 Quit

RE: Redmine svn integration - Added by Pieter Smith almost 14 years ago

If Apache2 is configured with DocumentRoot /var/www, you should put your repository in /var/www/svn:
  • Apache2 is attempting to authenticate <DocumentRoot>/svn which is what you asking it to do with your <Location> ... </Location> configuration above.
  • If you want to understand why, read the Apache2 documentation on how sections are merged
  • If you want to keep your repositories in /var/lib/svn, make a symlink /var/www/svn, and add the FollowSymLinks option to your Apache2 configuration.

RE: Redmine svn integration - Added by Jevgen Gyrynovych almost 14 years ago

Problem solved, thanks for the help.

RE: Redmine svn integration - Added by Jacob M almost 14 years ago

Mod_perl give few problems in Ubuntu 10.04

Uninstall with sudo apt-get remove --purge libapache2-mod-perl2

make: /etc/init.d/apache2 restart

and install again with:

 apt-get install libapache-dbi-perl libapache2-mod-perl2 libapache2-reload-perl
    (1-10/10)