Projet

Général

Profil

Wiki » Historique » Version 41

Patrice Nadeau, 2014-08-19 21:15

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