Projet

Général

Profil

Wiki » Historique » Version 43

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