Difference between revisions of "Redmine2 setup"

From ArchWiki
Jump to: navigation, search
(Complete the Redmine installation)
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
#REDIRECT [[Redmine]]
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]]
* [[MySQL]] (alternatively you could use [[PostgreSQL]] or [[Sqlite]], see [http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Database Official list of supported databases])
* [[Nginx]] (alternatively you could use [[Apache]], see [[Ruby on Rails#Application_servers]])
=== Ruby gems ===
Redmine requires some [https://wiki.archlinux.org/index.php/Ruby#RubyGems 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.
== Setup ==
=== Checkout ===
Get the Redmine source ([http://www.redmine.org/projects/redmine/wiki/Download 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;
== 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].

Latest revision as of 03:49, 3 May 2013

Redirect to: