Projet

Général

Profil

Wiki » Historique » Version 78

Patrice Nadeau, 2014-10-11 14:55

1 13 Patrice Nadeau
%{font-size:18pt}Redmine%
2
3
---
4
5 1 Patrice Nadeau
{{toc}}
6
7 13 Patrice Nadeau
h1. Redmine
8 6 Patrice Nadeau
9 31 Patrice Nadeau
Logiciel de gestion de projets, sources, bugs et timeline.
10
Contient un module de Wiki, de fichiers.
11
Supporte aussi les systèmes de version de fichier (Git, SVN entre autre).
12
Disponible à http://www.redmine.org/projects/redmine/wiki/Download
13
14
De base, ne fonctionne pas avec Apache
15 1 Patrice Nadeau
16 55 Patrice Nadeau
Sa principale difficulté d’installation est sa dépendance à Ruby.
17 31 Patrice Nadeau
Voir aussi :
18
* http://bitnami.com/stack/redmine
19
* http://www.turnkeylinux.org/redmine
20
21 6 Patrice Nadeau
h1. Installation
22
23 32 Patrice Nadeau
Ce guide documente une installation GNU/Linux avec les version suivantes :
24
* openSUSE 13.1
25
* Redmine 2.4.2
26
27 1 Patrice Nadeau
h2. Prérequis
28
29 56 Patrice Nadeau
Un serveur *LAMP(Linux, Apache, MySQL, PHP)* [[guides_opensuse:|openSUSE]] *fonctionnel*.
30 32 Patrice Nadeau
31 44 Patrice Nadeau
Les logiciels supplémentaires suivants :
32 50 Patrice Nadeau
33
<pre><code class="bash">
34 58 Patrice Nadeau
zypper install libmysqlclient-devel ruby-2.0 ruby20-devel rubygem-bundler  rubygem-mysql2 rubygem-pg ImageMagick ImageMagick-devel git gcc make
35 56 Patrice Nadeau
</code></pre>
36 32 Patrice Nadeau
37
h2. MySQL
38
39
Création de la base de donnés.
40
Substituer les items suivants à votre choix :
41
* redmine : Usager pour la base de donnés.
42
* password : Mot de passe de la base de donnees.
43
* db : Nom de la base de donnés.
44
45
Lancer MySQL :
46
<pre><code class="bash">
47
mysql -u root -p
48
</code></pre>
49
50
Commandes MySQL :
51
<pre><code class="sql">
52
create database db character set utf8;
53
create user 'redmine'@'localhost' identified by 'password';
54
grant all privileges on db.* to 'redmine'@'localhost';
55
commit;
56
quit;
57
</code></pre>
58
59 33 Patrice Nadeau
h2. Redmine
60 13 Patrice Nadeau
61 59 Patrice Nadeau
L’installation sera faite dans _\srv\redmine_ (exemple avec la version 2.5)
62 33 Patrice Nadeau
<pre><code class="bash">
63
cd /srv/
64 59 Patrice Nadeau
svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine
65 33 Patrice Nadeau
cd redmine
66
cp config/database.yml.example config/database.yml
67
cp config/configuration.yml.example config/configuration.yml
68
mkdir public/plugin_assets
69
</code></pre>
70
71
Si un usager MySQL autre que _root_ ou mot de passe diffèrent est utilisé :
72
Éditer le fichier *config/database.yml*, section *Production* et modifier les lignes :
73
* *username*
74
* *password*
75
76
Éditer le fichier _config/configuration.yml_ et modifier la configuration SMTP.
77
78
h2. Ruby
79
80 34 Patrice Nadeau
Installation des gems de Ruby
81 1 Patrice Nadeau
<pre><code class="bash">
82 34 Patrice Nadeau
cd redmine
83
gem install bundler
84
gem install activerecord-mysql2-adapter
85
bundle install --without development test
86 1 Patrice Nadeau
</code></pre>
87 34 Patrice Nadeau
88
h2. Initialisation
89
90
Création de la cryptographie, de la structure et des donnés de base :
91
<pre><code class="bash">
92
cd /srv/redmine
93
rake generate_secret_token
94
RAILS_ENV=production rake db:migrate
95
RAILS_ENV=production rake redmine:load_default_data
96
</code></pre>
97
98 69 Patrice Nadeau
h2. Serveur web
99
100 70 Patrice Nadeau
Redmine peux être utiliser avec le serveur inclus _webrick_ (port 3000) ou _Apache_ (port 80).
101
102 69 Patrice Nadeau
h3. Webrick
103
104 60 Patrice Nadeau
Ouvrir dans le pare-feu le port TCP 3000 :
105
<pre><code class="bash">
106
yast firewall services add tcpport=3000 zone=EXT
107 34 Patrice Nadeau
</code></pre>
108 1 Patrice Nadeau
109 69 Patrice Nadeau
Lancer le serveur web
110 34 Patrice Nadeau
<pre><code class="bash">
111 1 Patrice Nadeau
cd /srv/redmine
112 34 Patrice Nadeau
ruby script/rails server webrick -e production
113
</code></pre>
114 16 Patrice Nadeau
115 69 Patrice Nadeau
h4. Transformation en daemon
116 35 Patrice Nadeau
117
Le script original vient de http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_openSUSE
118
Copier le script dans le fichier */etc/init.d/redmine*
119
120
Le modifier de la manière suivante :
121
* REDMINE_BIN=/srv/redmine/current/script/rails
122
* REDMINE_USER=user
123
* Corriger le «typo» à la ligne 73 : $REDMI-NE_BIN -> $REDMINE_BIN
124
* Dans la section stop, après la ligne killproc, ajouter *rm $PIDFILE*
125
126
Rendre le fichier exécutable, l’ajouter aux services SUSE et l’exécuter au démarrage :
127
<pre><code class="bash">
128
chmod 0755 /etc/init.d/redmine
129
cp -s /etc/init.d/redmine /usr/bin/rcredmine
130
chkconfig -a redmine
131
</code></pre>
132
133 69 Patrice Nadeau
h3. Apache
134 45 Patrice Nadeau
135
> En test, voir #23
136
137
Transformation pour utilisation avec Apache.
138
* N'utilise pas _webrick_
139
* Accessible par le port 80 au lieu de 3000
140
141
Information provenant de :
142 54 Patrice Nadeau
* web : 
143
** http://martin-denizet.com/install-redmine-2-5-x-with-git-and-subversion-on-debian-with-apache2-rvm-and-passenger/ 
144
** http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine
145 45 Patrice Nadeau
* livre : "Mastering Redmine":http://shop.oreilly.com/product/9781849519144.do
146
147 46 Patrice Nadeau
h2. Modules Apache
148
149
Ajout
150 45 Patrice Nadeau
<pre><code class="bash">
151 49 Patrice Nadeau
zypper install libcurl-devel apache2-devel apache2-mod_perl perl-Apache-DBI subversion-server
152 45 Patrice Nadeau
</code></pre>
153
154
Activation des modules Apache
155
<pre><code class="bash">
156
a2enmod ssl
157
a2enmod perl
158
a2enmod dav
159
a2enmod dav_svn
160
a2enmod dav_fs
161
a2enmod rewrite
162
a2enmod headers
163 1 Patrice Nadeau
</code></pre>
164
165 46 Patrice Nadeau
h2. Modules _Passenger_
166
167 45 Patrice Nadeau
<pre><code class="bash">
168
cd /srv/redmine
169
gem install passenger
170
passenger-install-apache2-module2.0
171 1 Patrice Nadeau
</code></pre>
172
173 46 Patrice Nadeau
h2. Activation de la configuration
174
175 64 Patrice Nadeau
Créer le fichier _/etc/apache2/conf.d/passenger.conf_ et ajouter la configuration inscrite par l'installation.
176 61 Patrice Nadeau
177 45 Patrice Nadeau
Ajouter dans _/etc/apache2/vhosts.d/vhost.conf_
178
<pre><code class="bash">
179
<VirtualHost *:80>
180 67 Patrice Nadeau
    # La ligne suivante est nécessaire seulement si plusieurs site web son présents sur le même serveur.
181 45 Patrice Nadeau
    ServerName redmine.yourdomain.com
182
    DocumentRoot /srv/redmine/public
183
184 1 Patrice Nadeau
    RailsEnv production
185 67 Patrice Nadeau
    PassengerAppRoot /srv/redmine
186 45 Patrice Nadeau
187
    <Directory "/srv/redmine/public">
188
        Options Indexes ExecCGI FollowSymLinks
189 1 Patrice Nadeau
        AllowOverride None
190
        Order deny,allow
191
        Allow from all
192
    </Directory>
193
</VirtualHost>
194 65 Patrice Nadeau
</code></pre>
195
196
Relancer Apache :
197
<pre><code class="bash">
198
systemctl reload apache2
199 45 Patrice Nadeau
</code></pre>
200
201 78 Patrice Nadeau
Changer les droits des répertoires :
202 1 Patrice Nadeau
<pre><code class="bash">
203 78 Patrice Nadeau
cd /srv/redmine/public
204
chmod 0777 plugin_assets
205
206
207 68 Patrice Nadeau
208
h1. Post-installation
209
210 71 Patrice Nadeau
A partir d’un navigateur web, se brancher à :
211
* Webrick : http://server:3000
212
* Apache : http://server
213
214 69 Patrice Nadeau
Utiliser l’usager *admin* avec le mot de passe *admin*.
215
Vérifier la configuration dans *Administration*, *Information*.
216 66 Patrice Nadeau
217 75 Patrice Nadeau
218
219 29 Patrice Nadeau
h1. Personnalisation
220 8 Patrice Nadeau
221 36 Patrice Nadeau
h2. Ajout d’un logo
222
223
Les informations viennent de : http://www.redmine.org/projects/redmine/wiki/Howto_add_a_logo_to_your_Redmine_banner
224
225
Copier le logo dans _/srv/redmine/public/images/logo.png_
226 1 Patrice Nadeau
227 37 Patrice Nadeau
Modifier le fichier _/srv/redmine/app/views/layout/base.rhtml.erb_
228
* Ajouter la ligne 
229 1 Patrice Nadeau
<pre><code class="ruby">
230 37 Patrice Nadeau
<img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/>
231
</code></pre>
232
* Si on ne veux plus afficher le titre, mettre en commentaire :
233
<pre><code class="ruby">
234 1 Patrice Nadeau
<!--<h1><%= page_header_title %></h1>-->
235 37 Patrice Nadeau
</code></pre>
236
237
Redémarrer Redmine
238 72 Patrice Nadeau
239 36 Patrice Nadeau
240 1 Patrice Nadeau
h2. Plugins
241
242 38 Patrice Nadeau
h3. Extended Fields
243
244
Permet de créer de nouveau champ dans la basse de donnés.
245
246
http://www.redmine.org/plugins/extended_fields
247
248
Installation : 
249
<pre><code class="bash">
250
cd /srv/redmine
251
svn co http://svn.s-andy.com/extended-fields plugins/extended_fields
252
rake redmine:plugins:migrate RAILS_ENV=production
253 1 Patrice Nadeau
</code></pre>
254 73 Patrice Nadeau
255
Relancer Redmine
256 38 Patrice Nadeau
257 4 Patrice Nadeau
h3. Redmine Rouge
258 12 Patrice Nadeau
259 1 Patrice Nadeau
Permet le support de langage supplémentaire pour l'affichage de la syntaxe d'un code source.
260 4 Patrice Nadeau
261 13 Patrice Nadeau
"Langage supporté":http://rouge.jayferd.us/demo
262 1 Patrice Nadeau
263
https://github.com/ngyuki/redmine_rouge
264
265
<pre>
266
<code class="bash">
267
cd /srv/redmine/plugins
268
git clone https://github.com/ngyuki/redmine_rouge.git
269
cd ..
270
bundle install
271
</code>
272
</pre>
273 74 Patrice Nadeau
274
Relancer redmine
275
276 5 Patrice Nadeau
277 22 Patrice Nadeau
h3. Code Highlight
278 9 Patrice Nadeau
279 10 Patrice Nadeau
http://www.redmine.org/plugins/codehightlight_button
280 9 Patrice Nadeau
281
Bouton permettant de sélectionner du code et d'activer la syntaxe selon un langage.
282 11 Patrice Nadeau
>Ne fonctionne pas pour les langages supplémentaires supportées par le « plug-in » _Redmine Rouge_. Voir "ici":https://github.com/mediatainment/redmine_codebutton/issues/2
283 9 Patrice Nadeau
284 1 Patrice Nadeau
Installation
285
<pre><code class="bash">
286 10 Patrice Nadeau
cd /srv/redmine/plugins
287
git clone https://github.com/mediatainment/redmine_codebutton.git
288
cd ..
289
rake redmine:plugins
290 9 Patrice Nadeau
rake redmine:plugins:migrate RAILS_ENV=production
291 10 Patrice Nadeau
# Relancer Redmine
292 1 Patrice Nadeau
rcredmine restart
293
</code></pre>
294 11 Patrice Nadeau
295 23 Patrice Nadeau
h3. Redmine Issue Checklist
296 11 Patrice Nadeau
297
Extends issues to store checklist items
298
299
http://redminecrm.com/projects/checklist
300
301
Installation
302
<pre><code class="bash">
303
cd /srv/redmine/plugins
304
wget http://redminecrm.com/license_manager/4200/redmine_issue_checklist-2_0_5.zip
305
unzip redmine_issue_checklist-2_0_5.zip
306
bundle exec rake redmine:plugins NAME=redmine_issue_checklist RAILS_ENV=production
307
# Relancer Redmine
308
rcredmine restart
309
</code></pre>
310
311
Configuration
312
Dans *Administration*
313
* *Plugins*
314
** Choisir les options voulues
315
* *Roles and permissions*
316
** Choisir le rôle
317
Donner les droits voulus sur :
318
*** Done checklist items 
319
*** Edit checklist items 
320 14 Patrice Nadeau
*** View checklist
321 1 Patrice Nadeau
322 24 Patrice Nadeau
h3. Redmine People
323
324 29 Patrice Nadeau
> A faire
325 24 Patrice Nadeau
326 20 Patrice Nadeau
h3. WikiNG
327 1 Patrice Nadeau
328 20 Patrice Nadeau
Personnalisation des items dans le wiki.
329 28 Patrice Nadeau
Ajoute des boutons et des icônes comme FIXME et TODO.
330 29 Patrice Nadeau
> « Écrase » le bouton installé par _Code Highlight_
331 21 Patrice Nadeau
332
Installation
333 27 Patrice Nadeau
<pre><code class="bash">
334 26 Patrice Nadeau
cd /srv/redmine
335
wget http://projects.andriylesyuk.com/attachments/download/564/wiking-1.0.0b.tar.bz2
336
tar xvf wiking-1.0.0b.tar.bz2
337
mv wiking plugins
338
rake redmine:plugins:migrate RAILS_ENV=production
339
# restart Redmine
340
rcredmine restart
341
</code></pre>
342 20 Patrice Nadeau
343 14 Patrice Nadeau
h1. Mise à jour
344 1 Patrice Nadeau
345 14 Patrice Nadeau
S’assurer d'avoir les dernières versions des plugins.
346 9 Patrice Nadeau
347 41 Patrice Nadeau
Disponible a http://www.redmine.org/projects/redmine/wiki/Download 
348
349
Mise à jour de Redmine à partir de SVN (dernière version)
350
351
Vérifier la version pointée par SVN
352
<pre><code class="bash">
353
svn info
354
</code></pre>
355
356
Si ne pointe pas sur la bonne, faire le changement :
357
<pre><code class="bash">
358
svn switch http://svn.redmine.org/redmine/branches/2.4-stable
359
</code></pre>
360
361
Faire la mise à jour :
362
<pre><code class="bash">
363
svn update
364
</code></pre>
365
366
Installation des «gem» de Ruby.
367
>Vérifier la version de _rubygem-mysql2_ et modifier le fichier *Gemfile* pour la même version.
368
369
<pre><code class="bash">
370
cd /srv/redmine
371
rm -r /usr/lib64/ruby/gems/*
372
zypper rm rubygem-mysql2
373
zypper in rubygem-mysql2
374
gem install bundler
375
gem install activerecord-mysql2-adapter
376
bundle install --without development test
377
</code></pre>
378
379
Mise à jour (base de donnés, « plugins ») et ménage :
380
<pre><code class="bash">
381
rake db:migrate RAILS_ENV=production
382
rake redmine:plugins:migrate RAILS_ENV=production
383
rake tmp:cache:clear
384
rake tmp:sessions:clear
385
rcredmine restart
386
</code></pre>
387
388 14 Patrice Nadeau
h1. Copie de sécurité
389 5 Patrice Nadeau
390 40 Patrice Nadeau
Remplacer les items suivants :
391
* *username* : Usager de la base de donnés.
392
* *password* : Mot de passe de la base de donnés.
393
* *database* : Nom de la base de données.
394
* *path* : Emplacement pour recevoir le fichier.
395
396
<pre><code class="bash">
397
/usr/bin/mysqldump -u username -p password database | gzip > /path/redmine_`date +%y_%m_%d`.gz
398
rsync -a /srv/redmine/files /path/
399
</code></pre>
400
401
Script un peu plus evolué :
402 5 Patrice Nadeau
<pre> <code class="bash">
403 42 Patrice Nadeau
404 5 Patrice Nadeau
#!/bin/bash
405
#
406
# backup_redmine.sh
407
# Backup of a Redmine setup
408 1 Patrice Nadeau
# Last Changes: 2013-02-23
409 40 Patrice Nadeau
# Maintainer: Patrice Nadeau  <pnadeau@patricenadeau.com>
410 5 Patrice Nadeau
411
# TODO Verify the results (folder exist, enough disk pace , etc..)
412
413
## The only variable needed to be changed
414
# Directory of the Redmine install
415
declare -r RAIL_ROOT='/srv/redmine'
416
# MySQL database
417
declare -r MYSQL_DB=''
418
# MySQL username for the Redemine db
419
declare -r MYSQL_USER=''
420
# MySQL password for the Redemine db
421
declare -r MYSQL_PASSWORD=''
422
# Directory for the backup (must exist and with no space in the name)
423
declare -r DIR='/root'
424
## end
425
426
# Exit level
427
declare -ir EXIT_OK=0
428
declare -ir EXIT_WARNING=1
429
declare -ir EXIT_ERROR=2
430
431
declare -i STATUS=$EXIT_OK
432
433
# The directory inside the archive 
434
declare -r REDMINE='redmine'
435
TMP_DIR=$DIR/$REDMINE
436
437
# This will be used for the archive file 
438
declare -r DST=$DIR/redmine_$(date +%Y%m%d_%H%M%S).tar.gz
439
440
# The temporary sql file
441
declare -r TMP_MYSQL=$TMP_DIR/$MYSQL_DB.mysql
442
443
echo "Backup in progress in $DST"
444
445
#### Create the temp directory ####
446
mkdir $TMP_DIR
447
448
#### backup MySQL ####
449
if [ $STATUS -eq $EXIT_OK ] 
450
then
451
	STEP='Creating MySQL backup'
452
	mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DB \
453
		> $TMP_MYSQL
454
	STATUS=$?
455
fi
456
457
#### backup the Redmine folder ####
458
if [ $STATUS -eq $EXIT_OK ] 
459
then
460
	STEP='Creating Redmine'"'"' files backup'
461
	cp --recursive $RAIL_ROOT $TMP_DIR
462
	STATUS=$?
463
fi
464
465
#### create the archive file ####
466
if [ $STATUS -eq $EXIT_OK ] 
467
then
468
	STEP="Creating archive"
469
	tar --create --gzip --file $DST --directory=$DIR $REDMINE
470
	STATUS=$?
471
fi
472
473
#### cleanup ####
474
if [ $STATUS -eq $EXIT_OK ] 
475
then
476
	STEP='Cleaning up'
477
	rm --recursive --force $TMP_DIR
478
	STATUS=$?
479
fi
480
481
#### exit ####
482
if [ $STATUS -eq $EXIT_OK ] 
483
then
484
	echo "Backup done"
485
else
486
	echo "Bakup failed with error code $STATUS in step $STEP"
487
fi
488
489
490
exit $STATUS
491
492
</code></pre>
493 39 Patrice Nadeau
494
h1. Dépannage
495
496
h2. Mot de passe perdu
497
498
Le mot de passe admin par défaut est en _hash Sha1_ : *da3174755c5e82a436b6c7ff87c873ee50d6654b* et est *admin.*
499
500
h2. Le service tombe « DEAD » a chaque fois
501
502
Effacer le fichier _/srv/redmine/tmp/pids/server.pid_.