Projet

Général

Profil

Wiki » Historique » Version 49

Patrice Nadeau, 2014-10-05 12:17

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