User Tools

Site Tools


informatica:linux:redmine

This is an old revision of the document!


REDMINE

ruby project amangement gantt

Probado en Ubuntu 12.04.2 LTS

Instalacion

http://www.redmine.org/projects/redmine/wiki/RedmineInstall

1. Descarga y descompresion (en este ejemplo en '/var/www/redmine'):

http://www.redmine.org/projects/redmine/wiki/Download

cd /var/www
sudo wget http://rubyforge.org/frs/download.php/76771/redmine-2.2.3.tar.gz
sudo tar xvfz redmine-2.2.3.tar.gz
sudo ln -s redmine-2.2.3 redmine
sudo chown -R www-data:www-data redmine

2. (OPCIONAL) Instalar paquetes. Los necesitamos si vamos a usar MySQL y RMagick (para manipular PDF y PNG):

sudo aptitude install libmysqlclient-dev libmagickwand-dev

3. Instalar 'bundler' y las 'gems' requeridas:

3.1 (Opcional, solo para Debian) Instalar paquetes para que no casque la gem de json:

sudo aptitude install ruby-mkrf ruby-dev

3.2. Instalar:

sudo aptitude install rubygems
cd /var/www/redmine
sudo gem install bundler
sudo bundle install --without development test postgresql sqlite

OJO si intentamos 'sudo aptitude install rubygems -R' fallara en la instalacion de la gem de json

3.3. (Opcional)

Depende de la version de ruby:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!

En este caso:

sudo gem install rdoc-data; sudo rdoc-data --install

4. Crear el usuario para conectarse a la Base de Datos (MySQL en este ejemplo):

create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all on redmine.* to 'redmine'@'localhost';

5. Crear el archivo de configuracion (MySQL en este ejemplo):

sudo vim /var/www/redmine/config/database.yml

Con el siguiente contenido:

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: my_password

6. Generar la clave secreta de sesion:

cd /var/www/redmine; sudo rake generate_secret_token

7. Crear el esquema de Base de Datos (hacerlo como 'root' creo que es necesario):

cd /var/www/redmine; sudo RAILS_ENV=production rake db:migrate

8. Alimentar de datos la Base de Datos (hacerlo como 'root' creo que es necesario):

cd /var/www/redmine; sudo RAILS_ENV=production rake redmine:load_default_data

9. Arrancar el servidor web de prueba y probar que redmine es accesible:

cd /var/www/redmine; sudo ruby script/rails server webrick -e production

Abrir un navegador y acceder a redmine:

http://localhost:3000

Usuario y contrasenya: admin

Apache + SSL + redmine

http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine Seccion 'Ubuntu Server (Version ?) (This not don't work for 8.04 LTS)'

IMPORTANTE Seguir las instrucciones siguientes, es mucho mas simple que en las instrucciones de arriba.

1. Instalar el modulo passenger:

sudo aptitude install libapache2-mod-passenger

2. Configurar:

<VirtualHost *:443>
        ServerName redmine.myserver.com
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/redmine/public

        SSLEngine on
        SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        <Directory /var/www/redmine/public>
                RailsEnv production
                RailsBaseURI /redmine
                Options Indexes ExecCGI FollowSymLinks
                Order allow,deny
                allow from all
                AllowOverride all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/redmine.error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/redmine.access.log combined
</VirtualHost>

IMPORTANTE la ruta es /public (/var/www/redmine/public en el ejemplo)

3. Reiniciar apache:

sudo /etc/init.d/apache2 restart

4. Acceder:

http://redmine.myserver.com

Configuración correo

Si queremos que redmine envíe notificaciones:

1. Crear el archivo:

sudo vim /var/www/redmine/config/configuration.yml

Con el siguiente contenido:

production:
  email_delivery:
    delivery_method: :sendmail

2. (COMPROBAR) Creo que es necesario reiniciar el servidor de páginas web, apache en este caso:

sudo /etc/init.d/apache2 restart

3. Iniciar sesión en redmine con un usuario con permisos de administrador

4. Ir a Administration / Settings / Email notifications y realizar los ajustes pertinentes

5. Probar a asignar una tarea a un usuario, debería llegarle un mensaje. Se puede mirar los logs:

sudo tail -F /var/log/mail.log
...

Mar 21 18:25:06 itcumulus postfix/pickup[832]: AB7FB46031: uid=1000 from=<ubuntu>
Mar 21 18:25:06 itcumulus postfix/cleanup[2864]: AB7FB46031: message-id=<20130321182506.AB
7FB46031@localhost>
Mar 21 18:25:06 itcumulus postfix/qmgr[833]: AB7FB46031: from=<REMITE@DOMINIO.COM>, size
=338, nrcpt=1 (queue active)
Mar 21 18:25:07 itcumulus postfix/smtp[2868]: AB7FB46031: to=<DESTINO@DOMINIO.COM>, relay=ASPM
X.L.GOOGLE.com[173.194.75.26]:25, delay=0.52, delays=0.04/0.01/0.11/0.36, dsn=2.0.0, statu
s=sent (250 2.0.0 OK 1363890307 l8si26312242vdw.150 - gsmtp)
Mar 21 18:25:07 itcumulus postfix/qmgr[833]: AB7FB46031: removed

Autenticacion LDAP

Basico

1. Login como admin

2. Ir a Administration / LDAP authentication

3. Pulsar en “New authentication mode”

4. Rellenar los campos tal que asi:

Setting Value Comment
Name LDAP de Mi empresa
Host ldap.example.com
Port 636 Usamos LDAPS, no STARTTLS
LDAPS Marcado Usamos LDAPS, no STARTTLS
Account cn=admin,dc=example,dc=com Es recomendable crear un usuario con permisos de solo lectura en lugar de este
Password * -
Base DN ou=people,dc=example,dc=com -
On-the-fly user creation Marcado -
Login attribute uid -

5. Grabar

6. Probar

7. Si funciona y queremos mantener los mismos usuarios (opcion recomendable):

7.1. Iniciar sesion con un usuario con permisos de administrador (probablemente “admin”)

7.2. Ir a “Administration/users”

7.3. (Para cada uno de los usuarios) pulsar sobre el nombre

7.4. (Para cada uno de los usuarios) en el desplegable “Authentication mode” seleccionar LDAP (en nuestro caso aparecera “LDAP de Mi empresa”)

7.5. (Para cada uno de los usuarios) pulsar “Save”

Solo login si se pertenece a un grupo

1. (OpenLDAP server) Enable memberof overlay

1.1. Create a file:

vim ~/memberof_add.ldif

With below content:

dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulePath: /usr/lib/ldap
olcModuleLoad: memberof

1.2. Create a file:

vim ~/memberof_config.ldif

With below content:

dn: olcOverlay=memberof,olcDatabase={1}hdb,cn=config
objectClass: olcMemberOf
objectClass: olcOverlayConfig
objectClass: olcConfig
objectClass: top
olcOverlay: memberof
olcMemberOfDangling: ignore
olcMemberOfRefInt: TRUE
olcMemberOfGroupOC: groupOfNames
olcMemberOfMemberAD: member
olcMemberOfMemberOfAD: memberOf

1.3. Load them. It will depend on your OpenLDAP configuration, so we will propose some possibilities:

sudo ldapadd -c -Y EXTERNAL -H ldapi:/// -f memberof_add.ldif
sudo ldapadd -c -Y EXTERNAL -H ldapi:/// -f memberof_config.ldif

Or:

ldapadd -D cn=admin,cn=config -w "password" -H ldapi:/// -f memberof_add.ldif
ldapadd -D cn=admin,cn=config -w "password" -H ldapi:/// -f memberof_config.ldif

A restart is NOT needed if you use dynamic runtime configuration engine (slapd-config).

1.4. (Optional) Test it:

ldapsearch -D cn=admin,dc=example,dc=com -x -W -b 'dc=example,dc=com' -H 'ldap://127.0.0.1:389/' '(&(objectClass=posixAccount)(memberOf=cn=ldapredmine,ou=groups,dc=example,dc=com))'

2. (OpenLDAP server) Create the group. In this example the user is “ldap_user_1” and the group is “ldapredmine”:

dn: cn=ldapredmine,ou=groups,dc=example,dc=com
cn: ldapredmine
description: Staff members allowed to login to redmine ticketing system
member: cn=ldap_user_1,ou=people,dc=example,dc=com
objectclass: groupOfNames
objectclass: top

Adjust “dn” and “cn”s to fit to your DIT structure

3. (Redmine) Edit the LDAP authentication mode. In my case “ldap_user_1” is a “posixAccount” objectclass:

Base DN dc=example,dc=com
Filter (&(objectClass=posixAccount)(memberOf=cn=ldapredmine,ou=groups,dc=example,dc=com))

Incrementar nivel de logs

1. Crear el siguiente documento ('/srv/www/redmine' es la ruta a la instancia redmine):

sudo vim /srv/www/redmine/additional_environment.rb

Con el siguiente contenido:

config.logger = Logger.new('/var/log/redmine.log', 2, 1000000)
config.logger.level = Logger::INFO

2. Ajustar permisos por si las moscas:

sudo chown www-data:www-data /srv/www/redmine/additional_environment.rb

3. Reiniciar apache:

sudo /etc/init.d/apache restart

Errores

NameError (undefined local variable or method `disk_directory' for #<Attachment

Sucede porque no existe ese valor en la base de datos. Solucion:

cd /srv/www/redmine; sudo RAILS_ENV=production rake db:migrate
informatica/linux/redmine.1378379725.txt.gz · Last modified: 2015/04/13 20:19 (external edit)