Difference between revisions of "Redmine"

From ArchWiki
Jump to: navigation, search
m (Minimal database.yml: Fixed template typo.)
(Installation)
(22 intermediate revisions by 4 users not shown)
Line 4: Line 4:
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|Ruby on Rails}}
 
{{Article summary wiki|Ruby on Rails}}
 +
{{Article summary wiki|RVM}}
 +
{{Article summary wiki|MariaDB}}
 
{{Article summary end}}
 
{{Article summary end}}
  
This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux.
+
Redmine is a free and open source, web-based project management and bug-tracking tool. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. It handles multiple projects. Redmine provides integrated project management features, issue tracking, and support for various version control systems.
 +
 
 +
Redmine is written using the Ruby on Rails framework. It is cross-platform and cross-database.
  
 
==Prerequisites==
 
==Prerequisites==
  
===Needed packages===
+
This document will guide you through the installation process of the Redmine and all of its prerequisites, including the optional ones. If desired, however, you may install Redmine and it's prerequisites separately, simply refering to the relevant sections below.
Install the packages below as they are needed to proceed further.
+
 
 +
Although this guide will go through all the installation process, this isn't a one way path. So Redmine can use different versions of the other softwares (mariaDB, mySQL, postgreSQL, etc, as your database).
 +
 
 +
At this time is important to note that this guide is an default suggestion, feel free to use other of the prerequisites mentioned on this wiki, and to expand this guide.
 +
 
 +
===Ruby===
 +
 
 +
<table border="1">
 +
<tr>
 +
<th>Redmine version</th>
 +
<th>Supported Ruby versions</th>
 +
<th>Rails version used</th>
 +
<th>Supported RubyGems versions</th>
 +
</tr>
 +
<tr>
 +
<td rowspan="2">2.2.3</td>
 +
<td>ruby 1.8.7, 1.9.2, 1.9.3</td>
 +
<td rowspan="2">Rails 3.2.12</td>
 +
<td rowspan="2">RubyGems <= 1.8</td>
 +
</tr>
 +
<tr>
 +
<td>jruby-1.6.7</td>
 +
</tr>
 +
</table>
 +
 
 +
TODO: list and explain Ruby and RVM installation.
 +
 
 +
===Database===
 +
 
 +
====MariaDB 5.0 or higher (recommended)====
 +
make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running gem install mysql2.
 +
 
 +
====MySQL 5.0 or higher====
 +
make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running gem install mysql2.
 +
 
 +
====PostgreSQL 8.2 or higher====
 +
make sure your database datestyle is set to ISO (Postgresql default setting). You can set it using: ALTER DATABASE "redmine_db" SET datestyle="ISO,MDY";
 +
some bugs in PostgreSQL 8.4.0 and 8.4.1 affect Redmine behavior (#4259, #4314), they are fixed in PostgreSQL 8.4.2
 +
 
 +
====Microsoft SQL Server *new*====
 +
support is planned for 2.3.0 release (but is already available on trunk for early adopters)
 +
 
 +
====SQLite 3====
 +
(not for multi-user production use!)
 +
 
 +
==Optional Prerequisites==
 +
 
 +
===SCM (Source Code Management)===
 +
 
 +
TODO: list all scm supported and how to install them...
 +
 
 +
===ImageMagick===
 +
TODO: to enable Gantt export to png image.
 +
link: http://www.imagemagick.org/
 +
 
 +
===Ruby OpenID Library===
 +
TODO: to enable OpenID support (version 2 or greater is required).
 +
link: http://openidenabled.com/ruby-openid/
 +
 
 +
==Installation==
 +
 
 +
Download the package {{AUR|redmine_no_yet_in_AUR}} from the [[Arch User Repository|AUR]].
 +
 
 +
{{Note|The package is being prepepared, so wait a few days to use it.}}
 +
 
 +
Create the package following the build instructions at [[Arch User Repository#Build the package]].
 +
 
 +
{{Note|It's '''HIGHLY''' recommended to read all the [[Arch User Repository|AUR]] page to understand what are you doing. Although nothing dangerous are being done, it doesn't hurt to read this.}}
 +
 
 +
Enter the folder that you will are using to build packages, unpack the file and enter the package folder:
 +
 
 +
$ cd ~/builds
 +
$ tar -zxvf redmine-2.2.3.tar.gz
 +
$ cd redmine-2.2.3
 +
 
 +
Inspect the [[PKGBUILD]] file, to certify that nothing that is everything ok:
 +
$ nano PKGBUILD
 +
 
 +
And then, build the package:
 +
$ makepkg -s
 +
 
 +
{{Warning|Never run this using the {{ic|root}} user!}}
  
# pacman -Syu --needed sudo git wget curl checkinstall libxml2 libxslt mysql++ base-devel zlib icu redis openssh python2 python2-pygments python2-pip libyaml ruby subversion imagemagick postgresql-libs
 
  
 
===User accounts===
 
===User accounts===
Add {{ic|redmine2}} user and append redmine2 to git group.  
+
Add {{ic|redmine}} user and append redmine2 to git group.  
  
 
  # useradd --user-group --shell /bin/bash --comment 'redmine2 system' --create-home --groups git redmine2
 
  # useradd --user-group --shell /bin/bash --comment 'redmine2 system' --create-home --groups git redmine2
Line 48: Line 132:
 
  # sudo -u redmine2 -H bundle install  
 
  # sudo -u redmine2 -H bundle install  
  
{{Note|1= In order to install ruby bundle, you may be need add user redmine2 for /etc/sudoers }}
+
{{Note|1= In order to install ruby bundle, you may be need add user redmine2 for /etc/sudoers. Another option is to first do {{ic|1=export GEM_HOME=/home/redmine2/.gem/}}. }}
  
 
==Configure Redmine==
 
==Configure Redmine==
Line 91: Line 175:
  
 
{{Note|1= Notice that adapter is mysql2 and not mysql.}}
 
{{Note|1= Notice that adapter is mysql2 and not mysql.}}
 
  
 
<pre>
 
<pre>
Line 123: Line 206:
  
 
  # cd /home/redmine2/redmine-2.2
 
  # cd /home/redmine2/redmine-2.2
  # mkdir -pv tmp tmp/pdf public/plugin_assets
+
  # mkdir -pv tmp tmp/pdf public/plugin/assets
 
  # sudo chown -R redmine2:redmine2 files log tmp public/plugin/assets
 
  # sudo chown -R redmine2:redmine2 files log tmp public/plugin/assets
 
  # sudo chmod -R 755 files log tmp public/plugin/assets
 
  # sudo chmod -R 755 files log tmp public/plugin/assets

Revision as of 01:00, 2 March 2013

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Redmine is a free and open source, web-based project management and bug-tracking tool. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. It handles multiple projects. Redmine provides integrated project management features, issue tracking, and support for various version control systems.

Redmine is written using the Ruby on Rails framework. It is cross-platform and cross-database.

Prerequisites

This document will guide you through the installation process of the Redmine and all of its prerequisites, including the optional ones. If desired, however, you may install Redmine and it's prerequisites separately, simply refering to the relevant sections below.

Although this guide will go through all the installation process, this isn't a one way path. So Redmine can use different versions of the other softwares (mariaDB, mySQL, postgreSQL, etc, as your database).

At this time is important to note that this guide is an default suggestion, feel free to use other of the prerequisites mentioned on this wiki, and to expand this guide.

Ruby

Redmine version Supported Ruby versions Rails version used Supported RubyGems versions
2.2.3 ruby 1.8.7, 1.9.2, 1.9.3 Rails 3.2.12 RubyGems <= 1.8
jruby-1.6.7

TODO: list and explain Ruby and RVM installation.

Database

MariaDB 5.0 or higher (recommended)

make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running gem install mysql2.

MySQL 5.0 or higher

make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running gem install mysql2.

PostgreSQL 8.2 or higher

make sure your database datestyle is set to ISO (Postgresql default setting). You can set it using: ALTER DATABASE "redmine_db" SET datestyle="ISO,MDY"; some bugs in PostgreSQL 8.4.0 and 8.4.1 affect Redmine behavior (#4259, #4314), they are fixed in PostgreSQL 8.4.2

Microsoft SQL Server *new*

support is planned for 2.3.0 release (but is already available on trunk for early adopters)

SQLite 3

(not for multi-user production use!)

Optional Prerequisites

SCM (Source Code Management)

TODO: list all scm supported and how to install them...

ImageMagick

TODO: to enable Gantt export to png image. link: http://www.imagemagick.org/

Ruby OpenID Library

TODO: to enable OpenID support (version 2 or greater is required). link: http://openidenabled.com/ruby-openid/

Installation

Download the package redmine_no_yet_in_AURAUR from the AUR.

Note: The package is being prepepared, so wait a few days to use it.

Create the package following the build instructions at Arch User Repository#Build the package.

Note: It's HIGHLY recommended to read all the AUR page to understand what are you doing. Although nothing dangerous are being done, it doesn't hurt to read this.

Enter the folder that you will are using to build packages, unpack the file and enter the package folder:

$ cd ~/builds
$ tar -zxvf redmine-2.2.3.tar.gz
$ cd redmine-2.2.3

Inspect the PKGBUILD file, to certify that nothing that is everything ok:

$ nano PKGBUILD

And then, build the package:

$ makepkg -s
Warning: Never run this using the root user!


User accounts

Add redmine user and append redmine2 to git group.

# useradd --user-group --shell /bin/bash --comment 'redmine2 system' --create-home --groups git redmine2

MySQL user and databases

Create redmine2 user in MySQL server.

# mysql -u root -p
CREATE USER 'redmine2'@'%' IDENTIFIED BY  'MY_PASSWORD';
GRANT USAGE ON *.* TO  'redmine2'@'%' IDENTIFIED BY  'MY_PASSWORD';
GRANT ALL PRIVILEGES ON  `redmine2\_%`.* TO 'redmine2'@'%';
create database redmine2 character set utf8;
create database redmine2_production character set utf8;
create database redmine2_development character set utf8;
create database redmine2_test character set utf8;

Get lastest stable Redmine

Download

Checkout lastest from Redmine repository.

# cd /home/redmine2
# sudo -H -u redmine2 svn co http://svn.redmine.org/redmine/branches/2.2-stable redmine-2.2

Install gems

This could take a while as it installs all required libraries.

# sudo -u redmine2 -H sh -c 'echo "export PATH=$(ruby -rubygems -e "puts Gem.user_dir")/bin:$PATH" >> /home/redmine2/.bash_profile'
# sudo -u redmine2 -H gem install bundler
# cd /home/redmine2/redmine-2.2
# source /home/redmine2/.bash_profile
# sudo -u redmine2 -H bundle install 
Note: In order to install ruby bundle, you may be need add user redmine2 for /etc/sudoers. Another option is to first do export GEM_HOME=/home/redmine2/.gem/.

Configure Redmine

Application Settings

Copy default configuration and adjust settings for your needs.

# cd /home/redmine2/redmine-2.2/config
# sudo -u redmine2 cp configuration.yml.example configuration.yml
# sudo -u redmine2 cp database.yml.example database.yml

Minimal configuration.yml

For rapid reference.

default:
  email_delivery:
    delivery_method: :sendmail

  attachments_storage_path:

  autologin_cookie_name:
  autologin_cookie_path:
  autologin_cookie_secure:

  scm_subversion_command:
  scm_mercurial_command:
  scm_git_command:
  scm_cvs_command:
  scm_bazaar_command:
  scm_darcs_command:

  database_cipher_key:

production:

development:

Minimal database.yml

For rapid reference. Remember to replace MY_PASSWORD for yours.

Note: Notice that adapter is mysql2 and not mysql.
production:
  adapter: mysql2
  database: redmine2_production
  host: localhost
  username: redmine2
  password: MY_PASSWORD
  encoding: utf8

development:
  adapter: mysql2
  database: redmine2_development
  host: localhost
  username: redmine2
  password: MY_PASSWORD
  encoding: utf8

test:
  adapter: mysql2
  database: redmine2_test
  host: localhost
  username: redmine2
  password: MY_PASSWORD
  encoding: utf8

Permissions

Set permissions for redmine directories.

# cd /home/redmine2/redmine-2.2
# mkdir -pv tmp tmp/pdf public/plugin/assets
# sudo chown -R redmine2:redmine2 files log tmp public/plugin/assets
# sudo chmod -R 755 files log tmp public/plugin/assets

Generate secret token

Generate new unique secret token

# sudo -u redmine2 rake generate_secret_token

Migrate/install database

Create/update database schemas

# sudo -u redmine2 RAILS_ENV=production rake db:migrate

Populate database with default data.

# sudo -u redmine2 RAILS_ENV=production rake redmine:load_default_data

Test server

Ruby on Rails embedded server

Using Ruby on Rails embedded server

# ruby script/rails server webrick -e production

Test it http://localhost:3000 Use login=admin and password=admin

Unicorn server

# sudo -u redmine2 unicorn -D -E production -c config/unicorn.rb

Start redmine on boot

Append follow command at end of your /etc/rc.local

# sudo -u redmine2 bash -c "source /home/redmine2/.bash_profile && cd /home/redmine2/redmine-2.2 && unicorn -D -E production -c config/unicorn.rb"

Resources