Difference between revisions of "Redmine"

From ArchWiki
Jump to: navigation, search
(Redirected page to Redmine setup)
(Move from Redmine setup.)
Line 1: Line 1:
#REDIRECT [[Redmine setup]]
+
[[Category:Version Control System]]
 +
{{Article summary start}}
 +
{{Article summary text|This page gives guidelines for the installation and configuration of Redmine on Archlinux.}}
 +
{{Article summary heading|Related}}
 +
{{Article summary wiki|Ruby on Rails}}
 +
{{Article summary end}}
 +
 
 +
This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux.
 +
 
 +
==Prerequisites==
 +
 
 +
===Needed packages===
 +
Install the packages below as they are needed to proceed further.
 +
 
 +
# 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
 +
 
 +
===User accounts===
 +
Add {{ic|redmine2}} 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 {{ic|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://redmine.rubyforge.org/svn/branches/2.1-stable redmine-2.1
 +
 
 +
===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.1
 +
# source /home/redmine2/.bash_profile
 +
# sudo -u redmine2 -H bundle install
 +
 
 +
{{Note|1= In order to install ruby bundle, you may be need add user redmine2 for /etc/sudoers }}
 +
 
 +
==Configure Redmine==
 +
 
 +
===Application Settings===
 +
Copy default configuration and adjust settings for your needs.
 +
 
 +
# cd /home/redmine2/redmine-2.1/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.
 +
 
 +
<pre>
 +
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:
 +
</pre>
 +
 
 +
====Minimal database.yml====
 +
For rapid reference. Remember to replace MY_PASSWORD for yours.
 +
 
 +
<pre>
 +
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
 +
</pre>
 +
 
 +
===Permissions===
 +
Set permissions for redmine directories.
 +
 
 +
# cd /home/redmine2/redmine-2.1
 +
# 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.1 && unicorn -D -E production -c config/unicorn.rb"
 +
 
 +
== Resources ==
 +
* [http://www.redmine.org/projects/redmine/wiki/RedmineInstall  Official install guide from Redmine Wiki]

Revision as of 04:41, 24 November 2012

Summary help replacing me
This page gives guidelines for the installation and configuration of Redmine on Archlinux.
Related
Ruby on Rails

This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux.

Prerequisites

Needed packages

Install the packages below as they are needed to proceed further.

# 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

User accounts

Add redmine2 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://redmine.rubyforge.org/svn/branches/2.1-stable redmine-2.1

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.1
# 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

Configure Redmine

Application Settings

Copy default configuration and adjust settings for your needs.

# cd /home/redmine2/redmine-2.1/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.

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.1
# 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.1 && unicorn -D -E production -c config/unicorn.rb"

Resources