LINUXOR.SK ... open source notes ...

2014 - DEBIAN7 + Redmine2.3.2

category: howtoz/archive · date: 2014-01-09 · source: old.linuxor.sk/WWW/HOWTO_DEBIAN7_Redmine2-3-2_v01.txt

The Slovak original of this document: 2014 - DEBIAN7 + Redmine2.3.2 (slovensky).

asciiart
|=-------------------------------------------------=[ Redmine ]=----------------------------------------------=|
+--------------------------------------------------------------------------------------------------------------+
|                                                                                                              |
|                                                OS:  Debian 7.3.0                                             |
|                                               App:  Redmine 2.3.4                                            |
|                                                DB:  MySQL , PostgreSQL                                       |
|                                               WWW:  Nginx                                                    |
|                                                                                                              |
+--------------------------------------------------------------------------------------------------------------+
|=-------------------------------------------------=[ LH 2014 ]=----------------------------------------------=|

Preparation

asciiart
        Download Redmine (version 2.3.4 | 2.3.2) and unpack it
        --------------------------------------------------------------------------------------------------------
        # mkdir -p /var/www/pm
        # cd /var/www/pm
        # wget http://www.redmine.org/releases/redmine-2.3.4.tar.gz
        # wget http://files.rubyforge.vm.bytemark.co.uk/redmine/redmine-2.3.2.tar.gz
        # tar -xzf ./redmine-2.3.4.tar.gz
        # tar -xzf ./redmine-2.3.2.tar.gz
        # rm ./redmine-2.3.4.tar.gz
        # rm ./redmine-2.3.2.tar.gz
        # mv redmine-2.3.4 redmine
        # mv redmine-2.3.2 redmine

        Set the hostname and FQDN of the machine
        --------------------------------------------------------------------------------------------------------
        # hostname pm.employer.example

Installation - Ruby and its components

asciiart
        Install Ruby and the required libraries
        --------------------------------------------------------------------------------------------------------
        # apt-get install build-essential ruby1.9.1-dev libmysqlclient-dev libmagickwand-dev rake

        [1] Install the GEM "Bundler"
        [2] Install all the packages Redmine needs
        --------------------------------------------------------------------------------------------------------
        [0]# cd /var/www/pm/redmine
        [1]# gem install bundler
        [2]# bundle install --without development test

        Generate a random key/token
        --------------------------------------------------------------------------------------------------------
        # rake generate_secret_token

        Install the GEM "Phusion Passenger"
        --------------------------------------------------------------------------------------------------------
        # gem install passenger

Installation and configuration - Database - Mysql

asciiart
        Installing the MySQL server and its components
        --------------------------------------------------------------------------------------------------------
        # apt-get install mysql-server mysql-client mysql-common
        --------------------------------------------------------------------------------------------------------
        New password for the MySQL "root" user: <mysql_root_password>

        Log in as the user "root" and create the database
        --------------------------------------------------------------------------------------------------------
        # mysql -u root -p
        Enter password: <mysql_root_password>
        mysql> CREATE DATABASE redmine CHARACTER SET utf8;
        mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY '<redmine_db_password>';
        mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
        mysql> quit

        Configure Redmine to work with the database
        --------------------------------------------------------------------------------------------------------
        # cd /var/www/pm/redmine/config
        # cp ./database.yml.example ./database.yml
        # nano ./database.yml
        --------------------------------------------------------------------------------------------------------
        production:
          adapter: mysql2
          database: redmine
          host: localhost
          username: redmine
          password: <redmine_db_password>
          encoding: utf8
          schema_search_path: public

        Finish the database configuration
        --------------------------------------------------------------------------------------------------------
        # cd /var/www/pm/redmine/
        # chmod 600 ./config/database.yml
        # RAILS_ENV=production rake db:migrate
        # RAILS_ENV=production rake redmine:load_default_data

Installation and configuration - Database - PostgreSQL

asciiart
        Installing the PostgreSQL server
        --------------------------------------------------------------------------------------------------------
        # apt-get install postgresql

        Create and configure the database
        --------------------------------------------------------------------------------------------------------
        # su - postgres
        # psql
        --------------------------------------------------------------------------------------------------------
        CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD '<redmine_db_password>' NOINHERIT VALID UNTIL 'infinity';
        CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine TEMPLATE=template0;
        \q
        --------------------------------------------------------------------------------------------------------
        # exit

        Configure Redmine to work with the database
        --------------------------------------------------------------------------------------------------------
        # cd redmine/config
        # cp ./database.yml.example ./database.yml
        # nano ./database.yml
        --------------------------------------------------------------------------------------------------------
        production:
          adapter: postgresql
          database: redmine
          host: localhost
          username: redmine
          password: <redmine_db_password>
          encoding: utf8
          schema_search_path: public

        Finish the database configuration
        --------------------------------------------------------------------------------------------------------
        # chmod 600 ./database.yml
        # cd ..
        # RAILS_ENV=production rake db:migrate
        # RAILS_ENV=production rake redmine:load_default_data

Installation - Redmine

asciiart
        Final Redmine settings
        --------------------------------------------------------------------------------------------------------
        # adduser redmine
        # cd /var/www/pm/
        # chown -R redmine:redmine *
        # cd redmine
        # mkdir -p tmp tmp/pdf public/plugin_assets
        # chmod -R 755 files log tmp public/plugin_assets

        [1] Install the required/needed components
        [2] Install the Nginx web server with Passenger support
        --------------------------------------------------------------------------------------------------------
        [1]# apt-get install libcurl4-openssl-dev libssl-dev
        [2]# passenger-install-nginx-module

        [1] Install the control scripts for Nginx (since we installed, or rather run, Nginx through Passenger)
        [2] Edit the start script so that it points to the nginx binary managed by Passenger (quick and dirty)
        --------------------------------------------------------------------------------------------------------
        [1]# apt-get install nginx-extras
        [2]# nano /etc/init.d/nginx
        --------------------------------------------------------------------------------------------------------
        DAEMON=/opt/nginx/sbin/nginx
        ...
        start)
                    --exec $DAEMON -- $DAEMON_OPTS -c /opt/nginx/conf/nginx.conf || true
        ...
        stop)
                ...
                /usr/bin/killall nginx
        --------------------------------------------------------------------------------------------------------

        Setting up the web server - nginx
        --------------------------------------------------------------------------------------------------------
        # nano /opt/nginx/conf/nginx.conf
        --------------------------------------------------------------------------------------------------------
        user redmine;

        server {
             listen 80;
             server_name  pm.employer.example;
             root /var/www/pm/redmine/public/;
             access_log /var/www/pm/redmine/log/access.log;
             error_log /var/www/pm/redmine/log/error.log;
             index index.html;
             location / {
                passenger_enabled on;
                allow all;
             }
        }
        --------------------------------------------------------------------------------------------------------

        Restart the Nginx web server
        --------------------------------------------------------------------------------------------------------
        # /etc/init.d/nginx restart

Installation - Redmine plugins - BackLog -> http://www.redminebacklogs.net/

asciiart
        [1] Install the package "git" +
        [2] the other required libraries
        --------------------------------------------------------------------------------------------------------
        [1]# apt-get install git
        [2]# apt-get install libxslt1-dev

        [1] Move into the "plugins" directory and install the plugin "backlog"
        [2] Create a clone with the GIT client
        [3] Move into the directory "redmine_backlogs" and
        [4] list the available versions
        [5] Install the chosen version
        --------------------------------------------------------------------------------------------------------
        [1]# cd /var/www/pm/redmine/plugins
        [2]# git clone git://github.com/backlogs/redmine_backlogs.git
        [3]# cd redmine_backlogs
        [4]# git tag
        [5]# git checkout v1.0.6

        Make sure the "rake" tasks are run in the production environment
        --------------------------------------------------------------------------------------------------------
        # cd /var/www/pm/redmine/
        # RAILS_ENV=production
        # export RAILS_ENV

        Install the required GEM packages
        --------------------------------------------------------------------------------------------------------
        # gem install holidays thin open-uri-cached fastercsv yard shoulda redcarpet mocha prawn inifile chronic
        # gem install ZenTest -v 4.5.0
        # gem install autotest-rails
        # gem install faye-websocket -v 0.4.7
        # gem install poltergeist -v 1.0
        # gem install cucumber-rails culerity database_cleaner
        # gem install rspec -v 2.11.0
        # gem install rspec-rails -v 2.11.0
        # gem install simplecov -v 0.6
        # gem install ruby-prof spork
        # gem install timecop -v 0.3.5
        # gem install cucumber -v 1.1.0

        Configure Backlogs
        --------------------------------------------------------------------------------------------------------
        # cd /var/www/pm/redmine/
        # bundle exec rake db:migrate
        # bundle exec rake tmp:cache:clear
        # bundle exec rake tmp:sessions:clear
        # bundle exec rake redmine:backlogs:install

Installation - Redmine plugins - eKanban -> https://github.com/samchen2009/ekanban

asciiart
        Download the plugin "ekanban" into the plugin directory
        --------------------------------------------------------------------------------------------------------
        # cd /var/www/pm/redmine/plugins
        # wget https://github.com/samchen2009/ekanban/archive/master.zip
        # unzip ./master.zip
        # rm ./master.zip
        # mv ./ekanban-master ./ekanban

        Install the plugin
        --------------------------------------------------------------------------------------------------------
        # cd /var/www/pm/redmine/plugins
        # bundle install
        # rake redmine:plugins:migrate RAILS_ENV=production

        Restart the Nginx web server
        --------------------------------------------------------------------------------------------------------
        # /etc/init.d/nginx restart

Current practice (checked 2026-10)

noteThe article above is kept as it was written in 2014. This section lists what has changed since and what to do instead today.
bash
$ bundle config set --local without 'development test'
$ bundle install
$ bundle exec rake generate_secret_token
$ RAILS_ENV=production bundle exec rake db:migrate

Sources:

← howtoz/archive↓ bundle(EN | SK)