Difference between revisions of "Redmine2 setup"

From ArchWiki
Jump to: navigation, search
(Ruby gems: Merge to Redmine.)
(Complete the Redmine installation: Already in Redmine.)
Line 65: Line 65:
== Complete the Redmine installation ==
You can complete your installation by starting mysqld, import the database by following [http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Installation-procedure The official install guide].

Revision as of 01:38, 3 May 2013

Merge-arrows-2.pngThis article or section is a candidate for merging with Redmine.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Redmine2 setup#)

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



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 http://svn.redmine.org/redmine/branches/2.1-stable /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/redmine.ru, 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/redmine.ru


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;