Install Redmine with git and svn support over https on Debian wheezy using the Debian repository » History » Version 4

« Previous - Version 4/5 (diff) - Next » - Current version
Fedir RYKHTIK, 2014-06-10 22:20

Install Redmine with git and svn support over https on Debian wheezy using the Debian repository

This a short (incomplete) howto for those who want to stay within the debian repository.

  • Basic install using postgresql backend
    See references for configuration
    Redmine version 1.4.4 is present the debian repository.
    aptitude install postgresql redmine redmine-pgsql redmine-plugin-botsfilter
  • make sure all the necesarry modules for apache are loaded
    See references for configuration
    aptitude install libdbd-pg-perl
  • set up the vhosts
    See references for configuration
    • svn, apache enabled site
      in /etc/apache2/sites-enabled dir a site containing
      <VirtualHost *:443>
              DocumentRoot /var/www/redmine
              SSLEngine On
              SSLCertificateFile    /etc/apache2/ssl/yourcert.pem
              SSLCertificateKeyFile /etc/apache2/ssl/yourcert.key
              SSLCertificateChainFile /etc/apache2/ssl/yourcert.certificate_chain # optional, can be self signed
              <Directory /var/www/redmine>
                      RailsBaseURI /
                      PassengerResolveSymlinksInDocumentRoot on
                      AllowOverride None
              ErrorLog /var/log/apache2/error.log
              # Possible values include: debug, info, notice, warn, error, crit,
              # alert, emerg.
              LogLevel warn
              CustomLog /var/log/apache2/access.log combined
  • in conf.d dir eg svn.conf
    # /svn location for users
    PerlLoadModule Apache::Redmine
    <Location /svn>
        DAV svn
        SVNParentPath "/var/svn" 
        Order deny,allow
        Deny from all
        Satisfy any
        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler
        AuthType Basic
        AuthName "Projectwerk Subversion Repository" 
        #read-only access    
            Require valid-user
            # Allow from [my server ip]
            Allow from putyourserver.ipadress
            Allow from
            # Allow from another-ip
            Satisfy any
        # write access
            Require valid-user
        ErrorDocument 404 default
        # postgresqlconnection
        RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost" 
        RedmineDbUser "redmine" 
        RedmineDbPass "geheim" 
  • git

in conf.d dir a git.conf file

PerlLoadModule Apache::Redmine

SetEnv GIT_PROJECT_ROOT /var/git/
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/

<Location /git>
  AuthType Basic
  Require valid-user
  AuthName "Projectwerk Git Repository" 

  PerlAccessHandler Apache::Authn::Redmine::access_handler
  PerlAuthenHandler Apache::Authn::Redmine::authen_handler

  # postgresqlconnectie leggen
  RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost" 
  RedmineDbUser "redmine" 
  RedmineDbPass "geheim" 

don't forget to restart apache

  • set up cron repository creation
    See references for configuration
    • choose either only svn or git (one can only be the master repo)
    • if you want both u will need to register the second repo (git or svn) by hand on the redmine project site, for that you also need to make you use force.
      */5 * * * * root ruby /usr/share/redmine/extra/svn/reposman.rb --redmine localhost --scm Subversion --svn-dir /var/svn --owner www-data --url file:///var/svn --key=ARAZERAEZRZAER >> /var/log/redmine/reposman.log
      */30 * * * * root ruby /usr/share/redmine/extra/svn/reposman.rb -r localhost --scm Git --svn-dir /var/git --owner www-data --url /var/git --key=ARAZRRAEZRAEZRAEZ --verbose -f >> /var/log/redmine/reposman.log
  • svn repo appear after enabling repository module on the site,
    if u also have the git cron added, then u can add the git repo manually,
    redmine will complain, but it exists. So checkout the git repo, add a file, commit and push to server, redmine will no longer complain.