Redmine es una herramienta para la gestión de proyectos que incluye un sistema de seguimiento de incidentes con seguimiento de errores. Otras herramientas que incluye son calendario de actividades, diagramas de Gantt para la representación visual de la línea del tiempo de los proyectos, wiki, foro, visor del repositorio de control de versiones, RSS, control de flujo de trabajo basado en roles, integración con correo electrónico, entre otras opciones.

Descargar paquete de redmine

Vamos a descargar la ultima version de redmine que podremos encontrar en la pagina web

root@redmine:/home/usuario# wget http://www.redmine.org/releases/redmine-3.3.2.zip
--2017-02-20 13:15:50--  http://www.redmine.org/releases/redmine-3.3.2.zip
Resolviendo www.redmine.org (www.redmine.org)... 46.4.36.71
Conectando con www.redmine.org (www.redmine.org)[46.4.36.71]:80... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 3882353 (3,7M) [application/zip]
Grabando a: “redmine-3.3.2.zip”

redmine-3.3.2.zip   100%[=====================>]   3,70M  1,07MB/s   en 3,5s

2017-02-20 13:15:54 (1,07 MB/s) - “redmine-3.3.2.zip” guardado [3882353/3882353]

Descomprimimos el .zip descargado

Vamos a descomprimir el fichero .zip y lo vamos a mover a la carpeta /var/www/html

root@redmine:/home/usuario/# mv redmine-3.3.2.zip /var/www/html/
root@redmine:/var/www/html/# rm -rf index.html
root@redmine:/var/www/html/# ls -l
total 3796
-rw-r--r--  1 root root 3882353 ene  7 09:44 redmine-3.3.2.zip

Y lo descomprimimos unzip redmine-3.3.2.zip

Instalamos ruby y rails

Redmine esta basado en Ruby por tanto tendremos que instalar ruby apt install rails ruby apache2 libapache2-mod-passenger

Instalamos dependencias necesarias

Las siguientes dependencias son necesarias para su correcto funcionamiento apt install imagemagick libmagickwand-dev

Instalación y configuración BD en MySQL

Primero instalamos MysqlServer y sus dependencias apt install mysql-server libmysqlclient-dev, accedemos como root a la base de datos y creamos la base de datos, un usuario y le asignamos privilegios:

root@redmine:/var/www/html/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 43
Server version: 5.5.54-0+deb8u1 (Debian)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE redmine CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> EXIT;
Bye

Configuramos el fichero database.yml

Vamos a editar el fichero database.yml, para que quede asi:

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "redmine"
  encoding: utf8

Creamos un bundle

Ahora nos crearemos un bundle donde instalaremos todas las dependencias de gemas que necesita redmine.

root@redmine:/var/www/html/redmine-3.3.2# bundle install --without development test
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake 12.0.0
Installing i18n 0.8.0
Installing json 1.8.6
Installing minitest 5.10.1
Installing thread_safe 0.3.5
Installing tzinfo 1.2.2
Installing activesupport 4.2.7.1
Installing builder 3.2.3
Using erubis 2.7.0
Installing mini_portile2 2.1.0
Installing nokogiri 1.7.0.1
Installing rails-deprecated_sanitizer 1.0.3
Installing rails-dom-testing 1.0.8
Installing loofah 2.0.3
Installing rails-html-sanitizer 1.0.3
Installing actionview 4.2.7.1
Installing rack 1.6.5
Installing rack-test 0.6.3
Installing actionpack 4.2.7.1
Installing globalid 0.3.7
Installing activejob 4.2.7.1
Installing mime-types-data 3.2016.0521
Installing mime-types 3.1
Installing mail 2.6.4
Installing actionmailer 4.2.7.1
Installing actionpack-action_caching 1.2.0
Installing actionpack-xml_parser 1.0.2
Installing activemodel 4.2.7.1
Installing arel 6.0.4
Installing activerecord 4.2.7.1
Installing public_suffix 2.0.5
Installing addressable 2.5.0
Using bundler 1.7.4
Installing coderay 1.1.1
Installing concurrent-ruby 1.0.4
Installing css_parser 1.4.8
Installing htmlentities 4.3.1
Installing thor 0.19.4
Installing railties 4.2.7.1
Installing jquery-rails 3.1.4
Installing mimemagic 0.3.2
Installing mysql2 0.3.21
Installing net-ldap 0.12.1
Installing protected_attributes 1.1.3
Installing ruby-openid 2.3.0
Installing rack-openid 1.4.2
Installing sprockets 3.7.1
Installing sprockets-rails 3.2.0
Installing rails 4.2.7.1
Installing rbpdf-font 1.19.0
Installing rbpdf 1.19.0
Installing redcarpet 3.3.4
Installing request_store 1.0.5
Installing rmagick 2.16.0
Installing roadie 3.2.1
Installing roadie-rails 1.1.1
Your bundle is complete!
Gems in the groups development and test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

Generamos un identificador de inicio

root@redmine:/var/www/html/redmine-3.3.2# bundle exec rake generate_secret_token

Migramos la BD

root@redmine:/var/www/html/redmine-3.3.2# RAILS_ENV=production bundle exec rake db:migrate

Realizamos configuración inicial

root@redmine:/var/www/html/redmine-3.3.2# RAILS_ENV=production bundle exec rake redmine:load_default_data

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, es-PA, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] es
====================================
Default configuration data loaded.

Habilitamos modulos de apache necesarios

Configuramos los modulos de apache passenger y rewrite para redmine:

root@redmine:/var/www/html/redmine-3.3.2# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart
root@redmine:/var/www/html/redmine-3.3.2# a2enmod passenger
Module passenger already enabled
root@redmine:/var/www/html/redmine-3.3.2# systemctl restart apache2

Editamos virtualhost para redmine

Editamos el fichero /etc/apache2/sities-availables/000-default:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/redmine-3.3.2/public

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html/redmine-3.3.2/public>
                Require all granted
                AllowOverride All
        </Directory>
</VirtualHost>

Habilitamos el sitio y reiniciamos apache:

root@redmine:/etc/apache2/sites-available# a2ensite redmine.conf
Enabling site redmine.
To activate the new configuration, you need to run:
  service apache2 reload
root@redmine:/etc/apache2/sites-available# systemctl restart apache2