GitHub clone based on Debian Squeeze, Gitolite, Git, Git-Daemon, MySQL, Nginx and Mongrel Cluster


  • fresh und updated debian squeeze installation (preferable 64bit)
  • login as root

PS: i am sorry, but i don´t like to comment any part and command of this install notes.
Copy and past should be work :P

Debian package install:

apt-get install imagemagick ruby ruby-dev libruby rubygems mysql-server libmysqlclient-dev libmagickwand-dev git sudo nginx

Ruby Gems package install:

gem install lockfile inifile net-ssh mysql rmagick rdoc mongrel mongrel_cluster
gem install rails -v=2.3.14
gem install i18n -v=0.4.2

you have to link some installed gems:

ln -s /var/lib/gems/1.8/bin/rake /usr/bin/
ln -s /var/lib/gems/1.8/bin/mongrel_rails /usr/bin/

User configuration

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

run visudo and add this content:

redmine  ALL=(git)      NOPASSWD:ALL
git ALL=(redmine) NOPASSWD:ALL

Setup Gitolite

... as Git user:

su git
cd ~

generate gitolite key pair for administration:

ssh-keygen -t dsa
  • Install path: /opt/gitolite/.ssh/gitolite_admin_id_rsa
  • using passphrase: no

getting sources:

wget -O gitolite.tar.gz
tar -xf gitolite.tar.gz

create .profile file in git home directory and put content:


prepare setup and install gitolite

source .profile
gl-setup -q ~/.ssh/
rm -rf sitaramc-gitolite-d59bc35 gitolite.tar.gz

give Redmine the administration key pair

mkdir 0700 /opt/redmine/.ssh
cp /opt/gitolite/.ssh/gitolite_admin_id_rsa* /opt/redmine/.ssh
chown -R redmine:redmine /opt/redmine/.ssh

Setup Redmine

... as Redmine user

su redmine
cd ~

getting sources:

wget -O redmine.tar.gz
tar -xf redmine.tar.gz
mv redmine-redmine-3490d2a/* .
rm -rf redmine-redmine-3490d2a redmine.tar.gz

add a MySQL user and a database for Redmine (find your own way :P).
Insert connection data in configuration file ("Production" part):

cp config/database.yml.example config/database.yml
nano config/database.yml

setup tables and example data:

rake generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

Setup plugin to manage repositories

cd vendor/plugins

getting sources:

wget -O redmine_plugin.tar.gz
tar -xf redmine_plugin.tar.gz
mv ericpaulbishop-redmine_git_hosting-fdca404 redmine_git_hosting
rm redmine_plugin.tar.gz

edit redmine_git_hosting/init.rb file and customize like you prefare, e.g:

httpServer 'yourRedmine.tld'
gitServer 'yourRedmine.tld'

comment out line 87 to disable Git Urls in repository view if you like

connect to localhost and accept the public key, cancel with ctrl+c and migrate the plugin

cd ~
ssh localhost
RAILS_ENV=production rake db:migrate_plugins

install mongrel/rails patch

cd ~/config/initializers/

Prepare Mongrel


mkdir /etc/mongrel
mkdir /var/run/mongrel
chown redmine:redmine /var/run/mongrel
mkdir /var/log/mongrel
chown redmine:redmine /var/log/mongrel


mongrel_rails cluster::configure -e production -p 3000 -N 3 -c /opt/redmine -C /etc/mongrel/redmine-cluster.yml -a --user redmine --group redmine -l /var/log/mongrel/mongrel.log -P /var/run/mongrel/

auto start up:

wget -O /etc/init.d/redmine
chmod +x /etc/init.d/redmine
update-rc.d redmine defaults

Setup Nginx

creating own SSL Cert. chain (only for testing, example!):

mkdir /etc/nginx/ssl
cd /etc/nginx/ssl
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key
openssl rsa -in -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt


wget -O /etc/nginx/sites-available/default

just overwrite existing file.

Setup Git-Daemon

wget -O /etc/init.d/git-daemon
chmod +x /etc/init.d/git-daemon
update-rc.d -f git-daemon defaults

Setup mail server

If you want to use a local mail server, like exim4:

aptitude install exim4
dpkg-reconfigure exim4-config

Select "internet site; mail is sent and received directly using SMTP" and otherwise put in a sane FQDN and email account for root email to be forwarded to

Then setup your configuration.yml to use your chosen delivery method:

su redmine
cd ~
cp config/configuration.yml.example config/configuration.yml
nano config/configuration.yml

Edit the section labelled '# default configuration options for all environments' to read as follows if you want to use a local mailer (ie remove SMTP settings) or else add in your SMTP server's details:

 # Outgoing emails configuration (see examples above)
delivery_method: :sendmail

then exit back to root




Login at http://yourRedmine.tld with:

Login: admin
password: admin

Updated by Andrew Perry about 12 years ago · 6 revisions