Wiki » Historique » Version 44
  Patrice Nadeau, 2014-08-19 21:23 
  
| 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 | 29 | Patrice Nadeau | h1. Personnalisation  | 
| 145 | 8 | Patrice Nadeau | |
| 146 | 36 | Patrice Nadeau | h2. Ajout d’un logo  | 
| 147 | |||
| 148 | Les informations viennent de : http://www.redmine.org/projects/redmine/wiki/Howto_add_a_logo_to_your_Redmine_banner  | 
||
| 149 | |||
| 150 | Copier le logo dans _/srv/redmine/public/images/logo.png_  | 
||
| 151 | 1 | Patrice Nadeau | |
| 152 | 37 | Patrice Nadeau | Modifier le fichier _/srv/redmine/app/views/layout/base.rhtml.erb_  | 
| 153 | * Ajouter la ligne  | 
||
| 154 | 1 | Patrice Nadeau | <pre><code class="ruby">  | 
| 155 | 37 | Patrice Nadeau | <img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/>  | 
| 156 | </code></pre>  | 
||
| 157 | * Si on ne veux plus afficher le titre, mettre en commentaire :  | 
||
| 158 | <pre><code class="ruby">  | 
||
| 159 | 1 | Patrice Nadeau | <!--<h1><%= page_header_title %></h1>-->  | 
| 160 | 37 | Patrice Nadeau | </code></pre>  | 
| 161 | |||
| 162 | Redémarrer Redmine  | 
||
| 163 | <pre><code class="bash">  | 
||
| 164 | rcredmine restart  | 
||
| 165 | 36 | Patrice Nadeau | </code></pre>  | 
| 166 | |||
| 167 | 1 | Patrice Nadeau | h2. Plugins  | 
| 168 | |||
| 169 | 38 | Patrice Nadeau | h3. Extended Fields  | 
| 170 | |||
| 171 | Permet de créer de nouveau champ dans la basse de donnés.  | 
||
| 172 | |||
| 173 | http://www.redmine.org/plugins/extended_fields  | 
||
| 174 | |||
| 175 | Installation :  | 
||
| 176 | <pre><code class="bash">  | 
||
| 177 | cd /srv/redmine  | 
||
| 178 | svn co http://svn.s-andy.com/extended-fields plugins/extended_fields  | 
||
| 179 | rake redmine:plugins:migrate RAILS_ENV=production  | 
||
| 180 | rcredmine restart  | 
||
| 181 | </code></pre>  | 
||
| 182 | |||
| 183 | 4 | Patrice Nadeau | h3. Redmine Rouge  | 
| 184 | 12 | Patrice Nadeau | |
| 185 | 1 | Patrice Nadeau | Permet le support de langage supplémentaire pour l'affichage de la syntaxe d'un code source.  | 
| 186 | 4 | Patrice Nadeau | |
| 187 | 13 | Patrice Nadeau | "Langage supporté":http://rouge.jayferd.us/demo  | 
| 188 | 1 | Patrice Nadeau | |
| 189 | https://github.com/ngyuki/redmine_rouge  | 
||
| 190 | |||
| 191 | <pre>  | 
||
| 192 | <code class="bash">  | 
||
| 193 | cd /srv/redmine/plugins  | 
||
| 194 | git clone https://github.com/ngyuki/redmine_rouge.git  | 
||
| 195 | cd ..  | 
||
| 196 | bundle install  | 
||
| 197 | 2 | Patrice Nadeau | # Relancer redmine  | 
| 198 | rcredmine restart  | 
||
| 199 | 1 | Patrice Nadeau | </code>  | 
| 200 | </pre>  | 
||
| 201 | 5 | Patrice Nadeau | |
| 202 | 22 | Patrice Nadeau | h3. Code Highlight  | 
| 203 | 9 | Patrice Nadeau | |
| 204 | 10 | Patrice Nadeau | http://www.redmine.org/plugins/codehightlight_button  | 
| 205 | 9 | Patrice Nadeau | |
| 206 | Bouton permettant de sélectionner du code et d'activer la syntaxe selon un langage.  | 
||
| 207 | 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  | 
| 208 | 9 | Patrice Nadeau | |
| 209 | 1 | Patrice Nadeau | Installation  | 
| 210 | <pre><code class="bash">  | 
||
| 211 | 10 | Patrice Nadeau | cd /srv/redmine/plugins  | 
| 212 | git clone https://github.com/mediatainment/redmine_codebutton.git  | 
||
| 213 | cd ..  | 
||
| 214 | rake redmine:plugins  | 
||
| 215 | 9 | Patrice Nadeau | rake redmine:plugins:migrate RAILS_ENV=production  | 
| 216 | 10 | Patrice Nadeau | # Relancer Redmine  | 
| 217 | 1 | Patrice Nadeau | rcredmine restart  | 
| 218 | </code></pre>  | 
||
| 219 | 11 | Patrice Nadeau | |
| 220 | 23 | Patrice Nadeau | h3. Redmine Issue Checklist  | 
| 221 | 11 | Patrice Nadeau | |
| 222 | Extends issues to store checklist items  | 
||
| 223 | |||
| 224 | http://redminecrm.com/projects/checklist  | 
||
| 225 | |||
| 226 | Installation  | 
||
| 227 | <pre><code class="bash">  | 
||
| 228 | cd /srv/redmine/plugins  | 
||
| 229 | wget http://redminecrm.com/license_manager/4200/redmine_issue_checklist-2_0_5.zip  | 
||
| 230 | unzip redmine_issue_checklist-2_0_5.zip  | 
||
| 231 | bundle exec rake redmine:plugins NAME=redmine_issue_checklist RAILS_ENV=production  | 
||
| 232 | # Relancer Redmine  | 
||
| 233 | rcredmine restart  | 
||
| 234 | </code></pre>  | 
||
| 235 | |||
| 236 | Configuration  | 
||
| 237 | Dans *Administration*  | 
||
| 238 | * *Plugins*  | 
||
| 239 | ** Choisir les options voulues  | 
||
| 240 | * *Roles and permissions*  | 
||
| 241 | ** Choisir le rôle  | 
||
| 242 | Donner les droits voulus sur :  | 
||
| 243 | *** Done checklist items  | 
||
| 244 | *** Edit checklist items  | 
||
| 245 | 14 | Patrice Nadeau | *** View checklist  | 
| 246 | 1 | Patrice Nadeau | |
| 247 | 24 | Patrice Nadeau | h3. Redmine People  | 
| 248 | |||
| 249 | 29 | Patrice Nadeau | > A faire  | 
| 250 | 24 | Patrice Nadeau | |
| 251 | 20 | Patrice Nadeau | h3. WikiNG  | 
| 252 | 1 | Patrice Nadeau | |
| 253 | 20 | Patrice Nadeau | Personnalisation des items dans le wiki.  | 
| 254 | 28 | Patrice Nadeau | Ajoute des boutons et des icônes comme FIXME et TODO.  | 
| 255 | 29 | Patrice Nadeau | > « Écrase » le bouton installé par _Code Highlight_  | 
| 256 | 21 | Patrice Nadeau | |
| 257 | Installation  | 
||
| 258 | 27 | Patrice Nadeau | <pre><code class="bash">  | 
| 259 | 26 | Patrice Nadeau | cd /srv/redmine  | 
| 260 | wget http://projects.andriylesyuk.com/attachments/download/564/wiking-1.0.0b.tar.bz2  | 
||
| 261 | tar xvf wiking-1.0.0b.tar.bz2  | 
||
| 262 | mv wiking plugins  | 
||
| 263 | rake redmine:plugins:migrate RAILS_ENV=production  | 
||
| 264 | # restart Redmine  | 
||
| 265 | rcredmine restart  | 
||
| 266 | </code></pre>  | 
||
| 267 | 20 | Patrice Nadeau | |
| 268 | 14 | Patrice Nadeau | h1. Mise à jour  | 
| 269 | 1 | Patrice Nadeau | |
| 270 | 14 | Patrice Nadeau | S’assurer d'avoir les dernières versions des plugins.  | 
| 271 | 9 | Patrice Nadeau | |
| 272 | 41 | Patrice Nadeau | Disponible a http://www.redmine.org/projects/redmine/wiki/Download  | 
| 273 | |||
| 274 | Mise à jour de Redmine à partir de SVN (dernière version)  | 
||
| 275 | |||
| 276 | Vérifier la version pointée par SVN  | 
||
| 277 | <pre><code class="bash">  | 
||
| 278 | svn info  | 
||
| 279 | </code></pre>  | 
||
| 280 | |||
| 281 | Si ne pointe pas sur la bonne, faire le changement :  | 
||
| 282 | <pre><code class="bash">  | 
||
| 283 | svn switch http://svn.redmine.org/redmine/branches/2.4-stable  | 
||
| 284 | </code></pre>  | 
||
| 285 | |||
| 286 | Faire la mise à jour :  | 
||
| 287 | <pre><code class="bash">  | 
||
| 288 | svn update  | 
||
| 289 | </code></pre>  | 
||
| 290 | |||
| 291 | Installation des «gem» de Ruby.  | 
||
| 292 | >Vérifier la version de _rubygem-mysql2_ et modifier le fichier *Gemfile* pour la même version.  | 
||
| 293 | |||
| 294 | <pre><code class="bash">  | 
||
| 295 | cd /srv/redmine  | 
||
| 296 | rm -r /usr/lib64/ruby/gems/*  | 
||
| 297 | zypper rm rubygem-mysql2  | 
||
| 298 | zypper in rubygem-mysql2  | 
||
| 299 | gem install bundler  | 
||
| 300 | gem install activerecord-mysql2-adapter  | 
||
| 301 | bundle install --without development test  | 
||
| 302 | </code></pre>  | 
||
| 303 | |||
| 304 | Mise à jour (base de donnés, « plugins ») et ménage :  | 
||
| 305 | <pre><code class="bash">  | 
||
| 306 | rake db:migrate RAILS_ENV=production  | 
||
| 307 | rake redmine:plugins:migrate RAILS_ENV=production  | 
||
| 308 | rake tmp:cache:clear  | 
||
| 309 | rake tmp:sessions:clear  | 
||
| 310 | rcredmine restart  | 
||
| 311 | </code></pre>  | 
||
| 312 | |||
| 313 | 14 | Patrice Nadeau | h1. Copie de sécurité  | 
| 314 | 5 | Patrice Nadeau | |
| 315 | 40 | Patrice Nadeau | Remplacer les items suivants :  | 
| 316 | * *username* : Usager de la base de donnés.  | 
||
| 317 | * *password* : Mot de passe de la base de donnés.  | 
||
| 318 | * *database* : Nom de la base de données.  | 
||
| 319 | * *path* : Emplacement pour recevoir le fichier.  | 
||
| 320 | |||
| 321 | <pre><code class="bash">  | 
||
| 322 | /usr/bin/mysqldump -u username -p password database | gzip > /path/redmine_`date +%y_%m_%d`.gz  | 
||
| 323 | rsync -a /srv/redmine/files /path/  | 
||
| 324 | </code></pre>  | 
||
| 325 | |||
| 326 | Script un peu plus evolué :  | 
||
| 327 | 5 | Patrice Nadeau | <pre> <code class="bash">  | 
| 328 | 42 | Patrice Nadeau | |
| 329 | 5 | Patrice Nadeau | #!/bin/bash  | 
| 330 | #  | 
||
| 331 | # backup_redmine.sh  | 
||
| 332 | # Backup of a Redmine setup  | 
||
| 333 | 1 | Patrice Nadeau | # Last Changes: 2013-02-23  | 
| 334 | 40 | Patrice Nadeau | # Maintainer: Patrice Nadeau <pnadeau@patricenadeau.com>  | 
| 335 | 5 | Patrice Nadeau | |
| 336 | # TODO Verify the results (folder exist, enough disk pace , etc..)  | 
||
| 337 | |||
| 338 | ## The only variable needed to be changed  | 
||
| 339 | # Directory of the Redmine install  | 
||
| 340 | declare -r RAIL_ROOT='/srv/redmine'  | 
||
| 341 | # MySQL database  | 
||
| 342 | declare -r MYSQL_DB=''  | 
||
| 343 | # MySQL username for the Redemine db  | 
||
| 344 | declare -r MYSQL_USER=''  | 
||
| 345 | # MySQL password for the Redemine db  | 
||
| 346 | declare -r MYSQL_PASSWORD=''  | 
||
| 347 | # Directory for the backup (must exist and with no space in the name)  | 
||
| 348 | declare -r DIR='/root'  | 
||
| 349 | ## end  | 
||
| 350 | |||
| 351 | # Exit level  | 
||
| 352 | declare -ir EXIT_OK=0  | 
||
| 353 | declare -ir EXIT_WARNING=1  | 
||
| 354 | declare -ir EXIT_ERROR=2  | 
||
| 355 | |||
| 356 | declare -i STATUS=$EXIT_OK  | 
||
| 357 | |||
| 358 | # The directory inside the archive  | 
||
| 359 | declare -r REDMINE='redmine'  | 
||
| 360 | TMP_DIR=$DIR/$REDMINE  | 
||
| 361 | |||
| 362 | # This will be used for the archive file  | 
||
| 363 | declare -r DST=$DIR/redmine_$(date +%Y%m%d_%H%M%S).tar.gz  | 
||
| 364 | |||
| 365 | # The temporary sql file  | 
||
| 366 | declare -r TMP_MYSQL=$TMP_DIR/$MYSQL_DB.mysql  | 
||
| 367 | |||
| 368 | echo "Backup in progress in $DST"  | 
||
| 369 | |||
| 370 | #### Create the temp directory ####  | 
||
| 371 | mkdir $TMP_DIR  | 
||
| 372 | |||
| 373 | #### backup MySQL ####  | 
||
| 374 | if [ $STATUS -eq $EXIT_OK ]  | 
||
| 375 | then  | 
||
| 376 | STEP='Creating MySQL backup'  | 
||
| 377 | mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DB \  | 
||
| 378 | > $TMP_MYSQL  | 
||
| 379 | STATUS=$?  | 
||
| 380 | fi  | 
||
| 381 | |||
| 382 | #### backup the Redmine folder ####  | 
||
| 383 | if [ $STATUS -eq $EXIT_OK ]  | 
||
| 384 | then  | 
||
| 385 | STEP='Creating Redmine'"'"' files backup'  | 
||
| 386 | cp --recursive $RAIL_ROOT $TMP_DIR  | 
||
| 387 | STATUS=$?  | 
||
| 388 | fi  | 
||
| 389 | |||
| 390 | #### create the archive file ####  | 
||
| 391 | if [ $STATUS -eq $EXIT_OK ]  | 
||
| 392 | then  | 
||
| 393 | STEP="Creating archive"  | 
||
| 394 | tar --create --gzip --file $DST --directory=$DIR $REDMINE  | 
||
| 395 | STATUS=$?  | 
||
| 396 | fi  | 
||
| 397 | |||
| 398 | #### cleanup ####  | 
||
| 399 | if [ $STATUS -eq $EXIT_OK ]  | 
||
| 400 | then  | 
||
| 401 | STEP='Cleaning up'  | 
||
| 402 | rm --recursive --force $TMP_DIR  | 
||
| 403 | STATUS=$?  | 
||
| 404 | fi  | 
||
| 405 | |||
| 406 | #### exit ####  | 
||
| 407 | if [ $STATUS -eq $EXIT_OK ]  | 
||
| 408 | then  | 
||
| 409 | echo "Backup done"  | 
||
| 410 | else  | 
||
| 411 | echo "Bakup failed with error code $STATUS in step $STEP"  | 
||
| 412 | fi  | 
||
| 413 | |||
| 414 | |||
| 415 | exit $STATUS  | 
||
| 416 | |||
| 417 | </code></pre>  | 
||
| 418 | 39 | Patrice Nadeau | |
| 419 | h1. Dépannage  | 
||
| 420 | |||
| 421 | h2. Mot de passe perdu  | 
||
| 422 | |||
| 423 | Le mot de passe admin par défaut est en _hash Sha1_ : *da3174755c5e82a436b6c7ff87c873ee50d6654b* et est *admin.*  | 
||
| 424 | |||
| 425 | h2. Le service tombe « DEAD » a chaque fois  | 
||
| 426 | |||
| 427 | Effacer le fichier _/srv/redmine/tmp/pids/server.pid_.  |