Redmine2 setup

From ArchWiki
Revision as of 13:55, 13 November 2012 by Spider.007 (Talk | contribs) (Checkout: updated svn url)

Jump to: navigation, search

This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux. Redmine recently migrated from Ruby version 1.8.7 to version 1.9.3, which is also the version that is in the official Arch repositories, making it easier to install.

Package installation

Archlinux packages

Start by installing these packages using pacman:

Ruby gems

Redmine requires some RubyGems to be installed and there are multiple ways of installing them (as listed on the referenced page). Personally I prefer pacgem, so I used that for this guide. Install the packages below by running `pacgem PACKAGENAME`:

  • prototype-rails
  • unicorn (an application-server)
  • mysql2 (high-performance Ruby bindings for MySQL)
  • coderay
  • erubis
  • fastercsv
  • rdoc
  • net-ldap
  • rack-openid

Obviously, if you choose a different database-server, or want to use a different application-server you should replace mysql2 and unicorn to your liking.



Get the Redmine source (Download instructions). We'll be installing Redmine directly from subversion in /srv/http/redmine/

# useradd -d /srv/http/redmine -s /bin/false redmine
# mkdir -p /srv/http/redmine
# svn checkout /srv/http/redmine
# chown -R redmine: /srv/http/redmine

Check previously installed gems

The Redmine devs included Bundler in Redmine, which can manage Gems just like pacman manages packages. Just remember you don't want bundler to install anything as it won't be tracked by pacman! Ideally we don't want to use Bundler at all, but Redmine has a hard dependency on it, so run the following command to assure Redmine all dependencies are met:

# bundle install --without development test rmagick postgresql sqlite

This should output a list of gems Redmine needs, all prefixed by 'Using ... (version)', and finally 'Your bundle is complete!'. Don't run this as root, but as a user that is NOT privileged to use sudo-without-password, because Bundler will install gems it misses and mess up what we nicely created with pacgem. Any missing gems should be installed with pacgem.

I hope the --without flags speak for themselves, if you use a different database you should add 'mysql' and remove your database from the list.

Unicorn configuration

Create a unicorn configuration file in /etc/unicorn/, using the example script provided in Ruby on Rails#Unicorn.

You could start Unicorn manually, but wel'll create a nice startup script for it. Put the following contents in /etc/systemd/system/unicorn.service:

Description=Unicorn application server

ExecStart=/usr/bin/unicorn -D -E production -c /etc/unicorn/


You can now easily start and stop unicorn using systemctl

Nginx Configuration

After setting up Nginx, configure unicorn as an upstream server using something like this (Warning: this is a stripped example. It probably doesn't work without additional configuration):

http {
	upstream unicorn {
		server fail_timeout=0;
		server fail_timeout=0;
		server fail_timeout=0;
		server fail_timeout=0;

	server {
		listen		80 default;

		location / {
			root			/srv/http/redmine/public;
			proxy_set_header	X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header Host   $http_host;
			proxy_redirect		off;
			proxy_pass		http://unicorn;

Complete the Redmine installation

You can complete your installation by starting mysqld, import the database and complete your installation using The official install guide.