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