Projet

Général

Profil

Wiki » Historique » Version 260

Patrice Nadeau, 2019-12-07 16:10

1 214 Patrice Nadeau
# Redmine
2 6 Patrice Nadeau
3 31 Patrice Nadeau
Logiciel de gestion de projets, sources, bugs et timeline.
4
Contient un module de Wiki, de fichiers.
5
Supporte aussi les systèmes de version de fichier (Git, SVN entre autre).
6
Disponible à http://www.redmine.org/projects/redmine/wiki/Download
7
8
De base, ne fonctionne pas avec Apache
9 1 Patrice Nadeau
10
Sa principale difficulté d’installation est sa dépendance à Ruby.
11
Voir aussi :
12 219 Patrice Nadeau
13 1 Patrice Nadeau
* http://bitnami.com/stack/redmine
14
* http://www.turnkeylinux.org/redmine
15
16 255 Patrice Nadeau
{{toc}}
17 254 Patrice Nadeau
18 214 Patrice Nadeau
## Installation
19 94 Patrice Nadeau
20 32 Patrice Nadeau
Ce guide documente une installation GNU/Linux avec les version suivantes :
21 225 Patrice Nadeau
* openSUSE Leap 15
22 231 Patrice Nadeau
* Redmine 3.4.6
23 32 Patrice Nadeau
24 214 Patrice Nadeau
### Prérequis
25 1 Patrice Nadeau
26
Un serveur *LAMP(Linux, Apache, MySQL, PHP)* [[guides_opensuse:|openSUSE]] *fonctionnel*.
27 56 Patrice Nadeau
28 44 Patrice Nadeau
Les logiciels supplémentaires suivants :
29 243 Patrice Nadeau
```bash
30
zypper install libmysqlclient-devel ruby-2.5 ruby2.5-devel ImageMagick ImageMagick-devel libxml2-devel libxslt-devel libmariadb-devl git gcc make gcc-c++
31
```
32 32 Patrice Nadeau
33 214 Patrice Nadeau
### MySQL
34 94 Patrice Nadeau
35 32 Patrice Nadeau
Création de la base de donnés.
36
Substituer les items suivants à votre choix :
37 214 Patrice Nadeau
38 32 Patrice Nadeau
* redmine : Usager pour la base de donnés.
39 224 Patrice Nadeau
* password : Mot de passe de la base de données.
40 32 Patrice Nadeau
* db : Nom de la base de donnés.
41
42 1 Patrice Nadeau
Lancer MySQL :
43 242 Patrice Nadeau
```bash
44 244 Patrice Nadeau
mysql -u root -p
45 242 Patrice Nadeau
```
46 1 Patrice Nadeau
47
Commandes MySQL :
48 242 Patrice Nadeau
```sql
49 244 Patrice Nadeau
create database db character set utf8;
50
create user 'redmine'@'localhost' identified by 'password';
51
grant all privileges on db.* to 'redmine'@'localhost';
52
commit;
53
quit;
54 1 Patrice Nadeau
```
55
56 219 Patrice Nadeau
### Redmine
57 32 Patrice Nadeau
58 214 Patrice Nadeau
L’installation sera faite dans **\srv\redmine** (exemple avec la version 3.4)
59 225 Patrice Nadeau
60 244 Patrice Nadeau
```bash
61
cd /srv/
62
svn co http://svn.redmine.org/redmine/branches/3.1-stable redmine
63
cd redmine
64
cp config/database.yml.example config/database.yml
65
cp config/configuration.yml.example config/configuration.yml
66
mkdir public/plugin_assets
67
```
68 219 Patrice Nadeau
69 33 Patrice Nadeau
Si un usager MySQL autre que _root_ ou mot de passe diffèrent est utilisé :
70 219 Patrice Nadeau
Éditer le fichier **config/database.yml**, section *Production* et modifier les lignes :
71 1 Patrice Nadeau
72 219 Patrice Nadeau
* **username**
73
* **password**
74 33 Patrice Nadeau
75 219 Patrice Nadeau
Éditer le fichier **config/configuration.yml** et modifier la configuration SMTP.
76
77 214 Patrice Nadeau
### Ruby
78 33 Patrice Nadeau
79 34 Patrice Nadeau
Installation des gems de Ruby
80 240 Patrice Nadeau
> Le « gem » rmagick ne fonctionne pas avec ImageMagick 2.7 (https://github.com/rmagick/rmagick/pull/299)
81 1 Patrice Nadeau
82 241 Patrice Nadeau
```bash
83 234 Patrice Nadeau
cd redmine
84 1 Patrice Nadeau
gem install bundler
85 240 Patrice Nadeau
# Install sans rmagick
86 234 Patrice Nadeau
bundle.ruby2.5 install --without development test rmagick
87 241 Patrice Nadeau
```
88 219 Patrice Nadeau
89 1 Patrice Nadeau
### Initialisation
90 214 Patrice Nadeau
91 1 Patrice Nadeau
Création de la cryptographie, de la structure et des donnés de base :
92
93 233 Patrice Nadeau
```bash
94
cd /srv/redmine
95
rake generate_secret_token
96
RAILS_ENV=production rake db:migrate
97
RAILS_ENV=production rake redmine:load_default_data
98
```
99 219 Patrice Nadeau
100 231 Patrice Nadeau
### Test
101 1 Patrice Nadeau
102 231 Patrice Nadeau
Le serveur inclus _webrick_ n'est pas conçu pour être utilisé en production.
103 1 Patrice Nadeau
104 231 Patrice Nadeau
Ouvrir dans le pare-feu le port TCP 3000 (ou simplement desactiver temporairement le parefeu) :
105 214 Patrice Nadeau
106 232 Patrice Nadeau
```bash
107
yast firewall services add tcpport=3000 zone=EXT
108
```
109 45 Patrice Nadeau
110 231 Patrice Nadeau
Se rendre au `server.tld:3000`
111 45 Patrice Nadeau
112 231 Patrice Nadeau
### Apache
113 45 Patrice Nadeau
114 1 Patrice Nadeau
Information provenant de :
115
116
* web : 
117
    * http://martin-denizet.com/install-redmine-2-5-x-with-git-and-subversion-on-debian-with-apache2-rvm-and-passenger/ 
118
    * http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine
119
    * http://www.redmine.org/boards/2/topics/43924
120
* livre : "Mastering Redmine":http://shop.oreilly.com/product/9781849519144.do
121
122
### Modules Apache
123
124
> Apache 2.4
125
126
Ajout
127 244 Patrice Nadeau
```bash
128
zypper install libcurl-devel apache2-devel apache2-mod_perl perl-Apache-DBI subversion-server
129
```
130 219 Patrice Nadeau
131
Activation des modules Apache
132 244 Patrice Nadeau
```bash
133
a2enmod ssl
134
a2enmod perl
135
a2enmod dav
136
a2enmod dav_svn
137
a2enmod dav_fs
138
a2enmod rewrite
139
a2enmod headers
140
```
141 219 Patrice Nadeau
142 1 Patrice Nadeau
Module _Passenger_
143 244 Patrice Nadeau
```bash
144
cd /srv/redmine
145
gem install passenger
146
passenger-install-apache2-module.ruby2.1
147
```
148 219 Patrice Nadeau
149
Changer les droits sur le fichiers de log
150 244 Patrice Nadeau
```bash
151
chmod 0666 log/production.log
152
```
153 214 Patrice Nadeau
154 46 Patrice Nadeau
Créer le dossier des fichiers temporaire
155 216 Patrice Nadeau
156 61 Patrice Nadeau
> Par défaut les fichiers sont dans _/tmp_ mais se font enlever par le « clean-up » journalier et doivent être refait avec un reload d'Apache
157 244 Patrice Nadeau
```bash
158
mkdir tmp/passenger
159
```
160 235 Patrice Nadeau
161
### Activation de la configuration
162
163
Créer le fichier **/etc/apache2/conf.d/passenger.conf** et ajouter la configuration inscrite par l'installation.
164 1 Patrice Nadeau
165 235 Patrice Nadeau
Ajouter dans **/etc/apache2/vhosts.d/vhost.conf**
166
167 245 Patrice Nadeau
```bash
168 215 Patrice Nadeau
<VirtualHost *:80>
169 235 Patrice Nadeau
	# La ligne suivante est nécessaire seulement si plusieurs site web son présents sur le même serveur.
170
	ServerName redmine.yourdomain.com
171
	DocumentRoot /srv/redmine/public
172
173
	RailsEnv production
174
	PassengerAppRoot /srv/redmine
175
	PassengerTempDir /srv/redmine/tmp/passenger
176
177 215 Patrice Nadeau
	<Directory "/srv/redmine/public">
178
		Options Indexes ExecCGI FollowSymLinks
179
		AllowOverride None
180 235 Patrice Nadeau
		Order deny,allow
181
		Require all granted
182
	</Directory>
183 45 Patrice Nadeau
</VirtualHost>
184 214 Patrice Nadeau
```
185 1 Patrice Nadeau
186 68 Patrice Nadeau
Relancer Apache :
187 1 Patrice Nadeau
188 220 Patrice Nadeau
```bash
189 71 Patrice Nadeau
systemctl reload apache2
190 1 Patrice Nadeau
```
191 69 Patrice Nadeau
192 1 Patrice Nadeau
## Post-installation
193
194 224 Patrice Nadeau
A partir d’un navigateur web, se brancher à :
195 1 Patrice Nadeau
196 82 Patrice Nadeau
* Webrick : http://server:3000
197 236 Patrice Nadeau
* Apache : http://server
198
199
Utiliser l’usager *admin* avec le mot de passe *admin*.
200
Vérifier la configuration dans *Administration*, *Information*.
201
202
Si un avertissement apparaît pour l’écriture des répertoires, changer les droits :
203
> Semble être nécessaire que pour Apache
204
205
```bash
206 220 Patrice Nadeau
cd /srv/redmine
207 1 Patrice Nadeau
chmod -R 0777 public/plugin_assets
208
chmod -R 0777 files
209
chown -R wwwrun:www tmp
210 29 Patrice Nadeau
# Pour la macro "thumbnails" du wiki, le plugin "redmine_people" nécessite au moins 0775
211 187 Patrice Nadeau
chmod -R 0777 tmp/thumbnails
212 1 Patrice Nadeau
```
213 187 Patrice Nadeau
214 36 Patrice Nadeau
215 224 Patrice Nadeau
## Personnalisation
216 1 Patrice Nadeau
217 224 Patrice Nadeau
### Ajout d’un logo
218 220 Patrice Nadeau
219
> Cette étape sera à refaire lors d'une mise à jour.
220 1 Patrice Nadeau
221 220 Patrice Nadeau
Les informations viennent de : http://www.redmine.org/projects/redmine/wiki/Howto_add_a_logo_to_your_Redmine_banner
222 186 Patrice Nadeau
223
* Copier le logo dans **/srv/redmine/public/images/logo.png**
224 220 Patrice Nadeau
225
* Modifier le fichier **/srv/redmine/app/views/layouts/base.html.erb**
226
227 224 Patrice Nadeau
* Si on ne veux plus afficher le titre, mettre en commentaire :
228 247 Patrice Nadeau
```
229
<!--<h1><%= page_header_title %></h1>-->
230
```
231 1 Patrice Nadeau
232
* Ajouter en dessous la ligne 
233 247 Patrice Nadeau
```
234
<img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/>
235
```
236 98 Patrice Nadeau
237 97 Patrice Nadeau
* Relancer Redmine
238 214 Patrice Nadeau
239 113 Patrice Nadeau
### Plugins
240 1 Patrice Nadeau
241 224 Patrice Nadeau
Modules supplémentaires pour ajouter des fonctionnalités à Redmine.
242 1 Patrice Nadeau
243 248 Patrice Nadeau
> Source de problème lors de mise à jour si incompatibilité (ce qui arrive a chaque mise à niveau...).
244 101 Patrice Nadeau
245
## Mise à jour
246 1 Patrice Nadeau
247 251 Patrice Nadeau
> Version 3.4.6 -> 4.0.5
248 220 Patrice Nadeau
249 1 Patrice Nadeau
S’assurer d'avoir les dernières versions des plugins ET qu'il sont compatibles avec la version de Redmine à installer.
250 221 Patrice Nadeau
251
Disponible à http://www.redmine.org/projects/redmine/wiki/Download 
252 220 Patrice Nadeau
253
Mise à jour de Redmine à partir d'une version stable
254
> http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
255 229 Patrice Nadeau
256 220 Patrice Nadeau
* Arrêter Redmine
257
* Renommer le répertoire actuel
258 249 Patrice Nadeau
```bash
259
cd /srv/
260
mv redmine redmine.old
261
```
262 1 Patrice Nadeau
263
* Télécharger la nouvelle version
264 249 Patrice Nadeau
```bash
265 250 Patrice Nadeau
wget http://www.redmine.org/releases/redmine-4.0.5.tar.gz
266 249 Patrice Nadeau
```
267 1 Patrice Nadeau
268
* Décompresser le fichier
269 249 Patrice Nadeau
```bash
270 250 Patrice Nadeau
tar xvf redmine-4.0.5.tar.gz
271
mv redmine-4.0.5 redmine
272 249 Patrice Nadeau
```
273 221 Patrice Nadeau
274
* Copier les anciens fichiers de configurations
275 249 Patrice Nadeau
````bash
276
cp redmine.old/config/configuration.yml redmine/config
277
cp redmine.old/config/database.yml redmine/config
278
cp -r redmine.old/files redmine
279
```
280 220 Patrice Nadeau
281
* Refaire la sécurité
282 249 Patrice Nadeau
```bash
283
chown -R root:root redmine
284
# Les commandes suivantes sont nécessaire seulement si Apache est utilisé
285
# Le même owner que config.ru doit être utiliser pour plusieurs dossier
286
chown wwwrun:www redmine/config.ru
287
mkdir redmine/tmp/passenger
288
chown -R wwwrun:www redmine/tmp
289
chmod 0777 redmine/public/plugin_assets
290
chmod -R 0777 redmine/files
291
```
292 220 Patrice Nadeau
293
* Ne copier que les « plugins » qui ne sont pas fournis par la nouvelle version de Redmine
294 260 Patrice Nadeau
```bash
295
cp -r redmine.old/plugins/* redmine/plugins
296
```
297 1 Patrice Nadeau
298
* Installer les « gems »
299 250 Patrice Nadeau
```bash
300
cd redmine
301
bundle.ruby2.5 install --without development test rmagick
302
```
303 1 Patrice Nadeau
304 220 Patrice Nadeau
* Mise à jour (base de donnés, « plugins ») et ménage :
305 250 Patrice Nadeau
````bash
306 1 Patrice Nadeau
bundle.ruby2.5 exec rake generate_secret_token
307 250 Patrice Nadeau
bundle.ruby2.5 exec rake db:migrate RAILS_ENV=production
308
bundle.ruby2.5 exec rake redmine:plugins:migrate RAILS_ENV=production
309 260 Patrice Nadeau
bundle.ruby2.5 exec rake tmp:cache:clear RAILS_ENV=production
310 250 Patrice Nadeau
```
311 214 Patrice Nadeau
312 40 Patrice Nadeau
* Remettre le logo (facultatif)
313 250 Patrice Nadeau
```bash
314
cd ..
315
cp redmine.old/public/images/logo.png redmine/public/images/
316
cp redmine.old/app/views/layouts/base.html.erb redmine/app/views/layouts/
317
```
318 1 Patrice Nadeau
319 214 Patrice Nadeau
* Réinstaller le module « Passenger » (voir plus haut)
320 1 Patrice Nadeau
* Relancer Redmine 
321
* Vérifier 
322
    * Administration
323 214 Patrice Nadeau
        * Informations
324 1 Patrice Nadeau
        * Plugins
325 220 Patrice Nadeau
        * Projects
326 1 Patrice Nadeau
        * Users
327
        * Roles & permissions
328
    * Essayer d'attacher un fichier à un projet
329
    * Essayer d’accéder au calendrier d'un projet
330
331
## Copie de sécurité
332
333
[[Copie de sécurité]]
334
335
336
337
## Dépannage
338
339
### Mot de passe perdu
340
341
Le mot de passe admin par défaut est en _hash Sha1_ : *da3174755c5e82a436b6c7ff87c873ee50d6654b* et est *admin.*
342
343
### Le service tombe « DEAD » à chaque fois (webrick)
344
345
Effacer le fichier **/srv/redmine/tmp/pids/server.pid**.