HowTo Install Redmine 2 integrated with Gitolite 2 on Debian Wheezy with Apache and Phusion Passenger » History » Revision 8

« Previous | Revision 8/19 (diff) | Next »
André Domarques, 2013-09-12 07:50

HowTo Install Redmine 2 integrated with Gitolite 2 on Debian Wheezy with Apache and Phusion Passenger


A quick step-by-step for install Redmine and Gitolite plugin on Debian Wheezy mainly using default packages.

If I missed something, let me know

Required packages

apt-get -y install sudo ssh bzip2 zip unzip apache2 libapache2-mod-passenger mysql-server libmysqlclient-dev ruby ruby1.9.1-dev git git-core gitolite libmagickcore-dev libmagickwand-dev

Users and ssh-key

Create an user for Redmine and another for Gitolite:

adduser --system --shell /bin/bash --gecos 'Git Administrator' --group --disabled-password --home /opt/gitolite git
adduser --system --shell /bin/bash --gecos 'Redmine Administrator' --group --disabled-password --home /opt/redmine redmine

Generate a ssh-key for redmine user. This user will be used as admin of Gitolite. The name of key should be redmine_gitolite_admin_id_rsa.

sudo su - redmine
ssh-keygen -t rsa -N '' -f ~/.ssh/gitolite_admin_id_rsa

Configuring Gitolite

dpkg-reconfigure gitolite

Type data bellow:

  • user: git
  • repos path: /opt/gitolite
  • admin ssh-key: /opt/redmine/.ssh/

Note about SSH

Visudo configuration


Add the following lines:

# temp - remove after installation
redmine    ALL=(ALL)      NOPASSWD:ALL

# redmine gitolite integration
redmine    ALL=(git)      NOPASSWD:ALL
git        ALL=(redmine)  NOPASSWD:ALL

Note that redmine user will be able to run root commands, but this is just to simplify the next steps, remove that line after installation.

Redmine installation

The installation and configuration is like the official documentation. Simply reproducing to maintain the flow on this how-to.

sudo su - redmine
cd ~
tar zxf redmine-2.3.2.tar.gz
mv redmine-2.3.2/* .
rm -Rf redmine-2.3.2

Create database and user

mysql -u root -p

CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';

Configure database and email

cd /opt/redmine/config
cp database.yml.example database.yml
cp configuration.yml.example configuration.yml
Check more at:

Create plugin assets directory

cd ~
mkdir public/plugin_assets

Now finish the installation.

sudo gem install bundler
bundle install --without development test postgresql sqlite
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

Redmine Gitolite integration

The plugin used on this how-to is the fork of jbox-web, you can get more information at:


cd ~/plugins
git clone

Install. It's necessary to run bundle again to install some new gems required by redmine_git_hosting plugin.

cd ~
bundle install
RAILS_ENV=production rake redmine:plugins:migrate
rake redmine_git_hosting:install_scripts RAILS_ENV=production WEB_USER=redmine

Apache mod_passenger configuration

Create a symbolic link.

su root
cd /var/www
ln -s /opt/redmine/public redmine

Configure the site.

vi /etc/apache2/sites-available/redmine

With following content:

RailsBaseURI /redmine
PassengerUserSwitching on
PassengerUser redmine
PassengerGroup redmine

Enable the site and restart apache.

a2ensite redmine
service apache2 restart

Environment details

Hope this helps =D.

Updated by André Domarques almost 11 years ago · 8 revisions