Wiki » Historique » Version 1
Patrick ENGWANG NGUEMA, 08 septembre 2025 10:02
| 1 | 1 | Patrick ENGWANG NGUEMA | # Wiki |
|---|---|---|---|
| 2 | # Guide d'installation Maarch RM sur serveur ubuntu |
||
| 3 | |||
| 4 | ## Vue d'ensemble |
||
| 5 | |||
| 6 | Ce guide documente l'installation complète de Maarch RM sur un serveur Ubuntu 24.04 équipé de Plesk, avec résolution des problèmes rencontrés. |
||
| 7 | |||
| 8 | **Résultat final :** Maarch RM accessible sur http://172.23.2.10:8080 avec les identifiants `superadmin/superadmin` |
||
| 9 | |||
| 10 | ## Environnement technique |
||
| 11 | |||
| 12 | - **Système d'exploitation :** Ubuntu 24.04 LTS |
||
| 13 | - **Serveur web :** Apache 2.4.58 + Plesk |
||
| 14 | - **Base de données :** PostgreSQL 16.9 |
||
| 15 | - **PHP :** Version avec extensions requises |
||
| 16 | - **Maarch RM :** Version depuis le dépôt Git officiel |
||
| 17 | |||
| 18 | ## Prérequis installés |
||
| 19 | |||
| 20 | ```bash |
||
| 21 | # Extensions PHP requises |
||
| 22 | apt-get install php-mcrypt php-pdo php-pdo-pgsql php-xsl php-mbstring |
||
| 23 | |||
| 24 | # Modules Apache |
||
| 25 | a2enmod rewrite |
||
| 26 | a2enmod env |
||
| 27 | |||
| 28 | # Outils système |
||
| 29 | apt-get install p7zip-full default-jre git openssl |
||
| 30 | |||
| 31 | # PostgreSQL |
||
| 32 | apt-get install postgresql |
||
| 33 | ``` |
||
| 34 | |||
| 35 | ## Étapes d'installation de base |
||
| 36 | |||
| 37 | ### 1. Création de l'utilisateur système |
||
| 38 | ```bash |
||
| 39 | useradd -m -g www-data maarch |
||
| 40 | ``` |
||
| 41 | |||
| 42 | ### 2. Configuration Apache pour l'utilisateur maarch |
||
| 43 | ```bash |
||
| 44 | # Modifier /etc/apache2/envvars |
||
| 45 | export APACHE_RUN_USER=maarch |
||
| 46 | ``` |
||
| 47 | |||
| 48 | ### 3. Récupération des sources |
||
| 49 | ```bash |
||
| 50 | cd /var/www |
||
| 51 | git clone https://labs.maarch.org/maarch/maarchRM.git laabs |
||
| 52 | ``` |
||
| 53 | |||
| 54 | ### 4. Configuration des permissions |
||
| 55 | ```bash |
||
| 56 | chown -R maarch:www-data laabs/ |
||
| 57 | chmod -R 775 laabs/ |
||
| 58 | ``` |
||
| 59 | |||
| 60 | ### 5. Configuration PostgreSQL |
||
| 61 | ```bash |
||
| 62 | # Connexion en tant que postgres |
||
| 63 | sudo -u postgres psql |
||
| 64 | |||
| 65 | # Création utilisateur et base |
||
| 66 | CREATE USER maarch WITH ENCRYPTED PASSWORD 'maarch'; |
||
| 67 | ALTER ROLE maarch WITH CREATEDB; |
||
| 68 | ALTER ROLE maarch WITH SUPERUSER; |
||
| 69 | CREATE DATABASE "maarchRM" WITH OWNER maarch; |
||
| 70 | ``` |
||
| 71 | |||
| 72 | ### 6. Installation du schéma et données |
||
| 73 | ```bash |
||
| 74 | cd /var/www/laabs/data/maarchRM/batch/pgsql |
||
| 75 | ./schema.sh -u=maarch -p=5432 -d="maarchRM" -h=127.0.0.1 |
||
| 76 | ./data.sh -u=maarch -p=5432 -d="maarchRM" -h=127.0.0.1 |
||
| 77 | ``` |
||
| 78 | |||
| 79 | ## Problèmes rencontrés et solutions |
||
| 80 | |||
| 81 | ### Problème 1 : Conflit avec Plesk sur le port 80 |
||
| 82 | |||
| 83 | **Symptôme :** Page par défaut de Plesk s'affiche au lieu de Maarch RM |
||
| 84 | |||
| 85 | **Cause :** Plesk contrôle Apache et intercepte toutes les requêtes sur le port 80 |
||
| 86 | |||
| 87 | **Solution :** Configuration sur port alternatif (8080) |
||
| 88 | |||
| 89 | ```bash |
||
| 90 | # Ajout du port dans /etc/apache2/ports.conf |
||
| 91 | Listen 8080 |
||
| 92 | |||
| 93 | # Création du fichier de configuration Apache |
||
| 94 | nano /etc/apache2/conf-available/maarch.conf |
||
| 95 | ``` |
||
| 96 | |||
| 97 | Contenu du fichier : |
||
| 98 | ```apache |
||
| 99 | <VirtualHost *:8080> |
||
| 100 | ServerName maarchrm |
||
| 101 | DocumentRoot /var/www/laabs/web/ |
||
| 102 | |||
| 103 | <Directory /var/www/laabs/web/> |
||
| 104 | AllowOverride All |
||
| 105 | Require all granted |
||
| 106 | Options Indexes FollowSymLinks |
||
| 107 | |||
| 108 | RewriteEngine On |
||
| 109 | RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -f |
||
| 110 | RewriteRule .* - [QSA,L] |
||
| 111 | RewriteRule ^(.*)$ /http.php [QSA,L] |
||
| 112 | </Directory> |
||
| 113 | |||
| 114 | SetEnv LAABS_INSTANCE_NAME "maarchRM" |
||
| 115 | SetEnv LAABS_APP "maarchRM" |
||
| 116 | SetEnv LAABS_BUNDLES "audit;auth;batchProcessing;contact;digitalResource;lifeCycle;organization;recordsManagement;filePlan;medona" |
||
| 117 | SetEnv LAABS_DEPENDENCIES "repository;xml;html;localisation;datasource;sdo;json;fileSystem;notification;PDF;csv;txt;timestamp;csv;diff" |
||
| 118 | SetEnv LAABS_PRESENTATION "maarchRM" |
||
| 119 | SetEnv LAABS_CONFIGURATION "../data/maarchRM/conf/configuration.ini" |
||
| 120 | SetEnv LAABS_LOG "../data/maarchRM/log.txt" |
||
| 121 | SetEnv LAABS_TMP_DIR "../data/maarchRM/tmp" |
||
| 122 | |||
| 123 | LimitRequestBody 0 |
||
| 124 | </VirtualHost> |
||
| 125 | ``` |
||
| 126 | |||
| 127 | Activation : |
||
| 128 | ```bash |
||
| 129 | a2enconf maarch |
||
| 130 | systemctl restart apache2 |
||
| 131 | ``` |
||
| 132 | |||
| 133 | ### Problème 2 : Erreur JSON malformé |
||
| 134 | |||
| 135 | **Symptôme :** |
||
| 136 | ``` |
||
| 137 | PHP Fatal error: Error decoding complex ini directive [Syntax error: malformed JSON] |
||
| 138 | ``` |
||
| 139 | |||
| 140 | **Cause :** Section `zippedFolder` commentée avec des points-virgules (`;`) au milieu d'une structure JSON dans `configuration.ini` |
||
| 141 | |||
| 142 | **Solution :** Suppression de la section commentée |
||
| 143 | |||
| 144 | ```bash |
||
| 145 | nano /var/www/laabs/data/maarchRM/conf/configuration.ini |
||
| 146 | ``` |
||
| 147 | |||
| 148 | Supprimer toutes les lignes commençant par `;` dans la section `packageConnectors`, notamment : |
||
| 149 | ```ini |
||
| 150 | ; 'zippedFolder' : { |
||
| 151 | ; 'label' : 'Dossiers compressés', |
||
| 152 | ; ... |
||
| 153 | ``` |
||
| 154 | |||
| 155 | ### Problème 3 : Bundle 'seda' manquant |
||
| 156 | |||
| 157 | **Symptôme :** |
||
| 158 | ``` |
||
| 159 | Bundle 'seda' not found in /var/www/laabs/core/Reflection/Bundle.php:55 |
||
| 160 | ``` |
||
| 161 | |||
| 162 | **Cause :** Bundle "seda" inclus dans la configuration Apache mais non disponible |
||
| 163 | |||
| 164 | **Solution :** Suppression du bundle "seda" de la liste dans la configuration Apache |
||
| 165 | |||
| 166 | Modifier la ligne dans `/etc/apache2/conf-available/maarch.conf` : |
||
| 167 | ```apache |
||
| 168 | # AVANT |
||
| 169 | SetEnv LAABS_BUNDLES "audit;auth;batchProcessing;contact;digitalResource;lifeCycle;organization;recordsManagement;filePlan;medona;seda" |
||
| 170 | |||
| 171 | # APRÈS |
||
| 172 | SetEnv LAABS_BUNDLES "audit;auth;batchProcessing;contact;digitalResource;lifeCycle;organization;recordsManagement;filePlan;medona" |
||
| 173 | ``` |
||
| 174 | |||
| 175 | ### Problème 4 : Extension PHP mbstring manquante |
||
| 176 | |||
| 177 | **Symptôme :** |
||
| 178 | ``` |
||
| 179 | Call to undefined function dependency\html\mb_convert_encoding() |
||
| 180 | ``` |
||
| 181 | |||
| 182 | **Cause :** Extension PHP mbstring non installée |
||
| 183 | |||
| 184 | **Solution :** |
||
| 185 | ```bash |
||
| 186 | apt-get install php-mbstring |
||
| 187 | systemctl restart apache2 |
||
| 188 | ``` |
||
| 189 | |||
| 190 | ### Problème 5 : Authentification échoue silencieusement |
||
| 191 | |||
| 192 | **Symptôme :** Aucun utilisateur ne peut se connecter, pas d'erreur dans les logs Apache |
||
| 193 | |||
| 194 | **Cause :** Utilisateur `superadmin` sans organisation assignée (champ `ownerOrgId` vide) |
||
| 195 | |||
| 196 | **Diagnostic :** |
||
| 197 | ```bash |
||
| 198 | # Vérification de l'organisation de l'utilisateur |
||
| 199 | psql -U maarch -d maarchRM -h localhost -c "SELECT \"ownerOrgId\" FROM auth.account WHERE \"accountId\" = 'superadmin';" |
||
| 200 | |||
| 201 | # Vérification des organisations disponibles |
||
| 202 | psql -U maarch -d maarchRM -h localhost -c "SELECT * FROM organization.organization;" |
||
| 203 | ``` |
||
| 204 | |||
| 205 | **Solution :** Assignation de l'organisation ACME à l'utilisateur |
||
| 206 | |||
| 207 | ```bash |
||
| 208 | # L'organisation ACME existait déjà, il fallait juste l'assigner |
||
| 209 | psql -U maarch -d maarchRM -h localhost -c "UPDATE auth.account SET \"ownerOrgId\" = 'ACME' WHERE \"accountId\" = 'superadmin';" |
||
| 210 | ``` |
||
| 211 | |||
| 212 | Vérification : |
||
| 213 | ```bash |
||
| 214 | psql -U maarch -d maarchRM -h localhost -c "SELECT \"accountId\", \"ownerOrgId\" FROM auth.account WHERE \"accountId\" = 'superadmin';" |
||
| 215 | ``` |
||
| 216 | |||
| 217 | ## Configuration finale |
||
| 218 | |||
| 219 | ### Fichiers de configuration clés |
||
| 220 | |||
| 221 | **confvars.ini :** |
||
| 222 | ```ini |
||
| 223 | @var.dsn = "pgsql:host=localhost;dbname=maarchRM;port=5432" |
||
| 224 | @var.username = maarch |
||
| 225 | @var.password = maarch |
||
| 226 | ``` |
||
| 227 | |||
| 228 | **Algorithme de hashage :** SHA256 (configuré dans `configuration.ini`) |
||
| 229 | |||
| 230 | ### Accès final |
||
| 231 | |||
| 232 | - **URL :** http://172.23.2.10:8080 |
||
| 233 | - **Utilisateur :** superadmin |
||
| 234 | - **Mot de passe :** superadmin |
||
| 235 | - **Organisation :** ACME |
||
| 236 | - **Rôle :** ADMIN_GENERAL |
||
| 237 | |||
| 238 | ## Points d'attention pour installations futures |
||
| 239 | |||
| 240 | 1. **Conflit Plesk :** Toujours utiliser un port alternatif (8080, 8081, etc.) |
||
| 241 | 2. **Configuration JSON :** Vérifier l'absence de sections commentées malformées dans les fichiers .ini |
||
| 242 | 3. **Bundles :** S'assurer que tous les bundles listés dans Apache sont disponibles |
||
| 243 | 4. **Extensions PHP :** Installer mbstring en plus des extensions de base |
||
| 244 | 5. **Organisations :** Vérifier que les utilisateurs ont une organisation assignée |
||
| 245 | 6. **Hashage des mots de passe :** Utiliser SHA256 simple sans salt supplémentaire |
||
| 246 | |||
| 247 | ## Commandes de diagnostic utiles |
||
| 248 | |||
| 249 | ```bash |
||
| 250 | # Vérifier les ports Apache |
||
| 251 | netstat -tlnp | grep apache |
||
| 252 | |||
| 253 | # Tester la connexion PostgreSQL |
||
| 254 | php -r "try { \$pdo = new PDO('pgsql:host=localhost;dbname=maarchRM;port=5432', 'maarch', 'maarch'); echo 'OK\n'; } catch (Exception \$e) { echo \$e->getMessage(); }" |
||
| 255 | |||
| 256 | # Vérifier les utilisateurs et organisations |
||
| 257 | psql -U maarch -d maarchRM -h localhost -c "SELECT a.\"accountId\", a.\"ownerOrgId\", o.\"orgName\" FROM auth.account a LEFT JOIN organization.organization o ON a.\"ownerOrgId\" = o.\"orgId\";" |
||
| 258 | |||
| 259 | # Surveiller les logs |
||
| 260 | tail -f /var/log/apache2/error.log |
||
| 261 | ``` |