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