Redmine on Archlinux

[Overview]
This entry will describe a basic installation and configuration of redmine, a flexible and cross-platform project management web application, on an archlinux system.

For the official installation guide, please refer this wiki page.

[Preparation]
1. Download the latest stable release of redmine (0.8.4) from rubyforge:

$ wget http://rubyforge.org/frs/download.php/56909/redmine-0.8.4.tar.gz

2. Install ruby and ruby on rails
(Notes: rails is optional since the redmine official release we download above already include the appropriate rails version (2.1.2) in its vendor directory)

3. Make sure rubygems and rake meet the version requirement of redmine:

gem -v >= 1.3.1
rake --version >= 0.8.3


[Database]
mysql is the recommended database of redmine, so here we will use mysql:

$ sudo pacman -S mysql

start mysql:

$ sudo /etc/rc.d/mysqld start

refer this wiki page for more information about mysql installation.

[Basic installation]
step 1: create redmine db with user “redmine”

$ mysql -u root -p
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'password';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';

step 2: configure redmine database settings for “production” environment

$ cd redmine-0.8.4
$ cp config/database.yml.example config/database.yml

edit config/database.yml, make the production section looks like:

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: password
encoding: utf8

step 3: create database structure and an administrator account

$ rake db:migrate RAILS_ENV="production"

the default administrator account is:

username: admin
password: admin

step 4: insert default configuration data in database

$ rake redmine:load_default_data RAILS_ENV="production"

according to the official wiki, this step is optional but highly recommended. It will load default roles, trackers, statuses, workflows and enumerations for our convenience.

step 5: test installation
start mongrel:

$ script/server -e production

point your browser to navigate http://server-domain-or-ip:3000/ to see the redmine welcome page, use the default admin account above to login.

redmine home:

redmine home

redmine administration setting:

redmine admin setting

[Deploy using phusion passenger (aka mod_rails)]
step 1: install passenger and its apache 2 module
install passenger:

$ sudo gem install passenger

install apache 2 module, please make sure g++, ruby, openssl and apache are installed before issue the command below:

$ sudo passenger-install-apache2-module

follow the screen instructions and pay attention to the console output, some of them will be used later.

step 2: deploy and set up permissions

$ sudo mkdir -p /srv/http/rails
$ sudo cp -r redmine-0.8.4 /srv/http/rails/
$ sudo chown -R http:http /srv/http/rails/redmine-0.8.4

step 3: configure apache to use passenger
add one include at the end of httpd.conf:

$ sudo echo "Include conf/extra/httpd-rails.conf" >> /etc/httpd/conf/httpd.conf

create the httpd-rails.conf:

$ cd /etc/httpd/conf/extra
$ sudo touch httpd-rails.conf

edit httpd-rails.conf, follow the former console output and add the passenger configuration there, below is my configuration, yours may be differ:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4
PassengerRuby /usr/bin/ruby

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName SERVER-DOMAIN-OR-IP
  DocumentRoot /srv/http/rails/redmine-0.8.4/public
  RailsEnv production
  ErrorLog /var/log/httpd/rails_error_log
  CustomLog /var/log/httpd/rails_access_log common
</VirtualHost>

step 4: restart apache and test installation

$ sudo /etc/rc.d/httpd restart

navigate http://SERVER-DOMAIN-OR-IP/ to see if anything is broken.

[Optional components]
we use subversion for repository browsing:

$ sudo pacman -S subversion

and enable Gantt export to png image:

$ sudo pacman -S imagemagick
$ sudo gem install rmagick

[Themes]
I like the Basecamp theme:

$ cd /srv/http/rails/redmine-0.8.4/public/themes
$ sudo wget http://www.redmine.org/attachments/1274/basecamp.zip
$ sudo unzip basecamp.zip
$ sudo chown -R http:http basecamp
$ sudo rm basecamp.zip

then the basecamp theme option is available in the drop-down list of “Theme” in the “General” tab under “Administration -> Settings”.

redmine basecamp

[SMTP]
to be continued…

[Plugins]
to be continued…

历史上的今天:

Related posts:

7 Comments on "Redmine on Archlinux"

  1. Ewoud Belgium Mozilla Linux says:

    hi,

    thx for this, it helped.

    grtz
    Ewoud

  2. Samson China Mozilla Firefox Windows says:

    you’re welcome~

  3. Sunng China Opera Windows says:

    今天我准备部这个,在一台什么都没有的服务器上

  4. erick2red Cuba Google Chrome Linux says:

    Hey, dude, thanks, i was looking a lot for this HOWTO, and this was the one who work.

    Thanks. Nice tutorial

  5. With thanks, I like it.

Got something to say? Go for it!

使用新浪微博登陆