MediaWiki/Serveur internet sous Windows

Aller à la navigation Aller à la recherche

La création d'un serveur internet sous Windows.

Plus précisément, sous Windows 10 Pro.

Prérequis

Organisation des dossiers sur le serveur

  • C:\phpwamp\apache\
  • C:\phpwamp\log\
  • C:\phpwamp\mysql\
  • C:\phpwamp\php\
  • C:\phpwamp\tmp\
  • C:\phpwamp\www\ : contiendra tous les sous-dossiers correspondants aux différents sites
    • C:\phpwamp\www\phpmyadmin\ : dossier pour phpMyAdmin
    • C:\phpwamp\www\site1\ : dossier pour le premier site
    • C:\phpwamp\www\site2\ : dossier pour le deuxième site

Les sources

Apache, Apache 2.4.48

MySQL, MySQL Community Server 8.0.26

PHP, version 7.4.23

phpmyadmin, version 5.1.1

MediaWiki, version 1.36.1 ; non compatible avec PHP 8.x

MySQL et prérequis

Site officiel de MySQL

MySQL Community Server :

PHP 7.4.x ou plus récent, avec les extensions suivantes :

  • ctype
  • iconv
  • json
  • mbstring
  • xml
  • openssl, fortement recommandé

MySQL :

  • MySQL x.x.x ou plus récent

MySQL, installation

Choix des éléments :

  • MySQL Server 8.0.26 - x64
  • MySQL Workbench 8.0.26 - x64
  • Connector/ODBC 8.0.26 - x64
  • Samples and Examples 8.0.26 - x86
  • MySQL Documentation - x86

Outils

Paramétrage

Apache

Apache, httpd.conf, ajouter les lignes suivantes

  • LoadModule php7_module "...\php\php7apache2_4.dll"
  • AddHandler application/x-httpd-php .php
  • # configure the path to php.ini
  • PHPIniDir ...

Apache, httpd.conf, modifier

  • ServerRoot "C:\phpwamp/apache24"
  • Listen 80
  • DocumentRoot "C:\phpwamp/www"
  • <Directory "C:\phpwamp/www">

Apache, httpd.conf, modifier

<IfModule dir_module>
   DirectoryIndex index.html, index.htm, index.php
</IfModule>

Problème connu

Si certaines extension PHP ne sont pas chargées (notamment curl, intl, ldap), ajouter les chemins systèmes suivants :

C:\phpwamp\php\
C:\phpwamp\php\ext\

PHP

PHP, php.ini

  • extension_dir = "C:\phpwamp\php\ext"
  • session.save_path = "C:\phpwamp\tmp"

phpinfo.php

<?php
// Affiche toutes les informations, comme le ferait INFO_ALL
phpinfo();
?>

PHP, les extensions

PHP, php.ini

  • extension=intl ; pour MediaWiki

SSL

Commandes

Installation du service Apache

C:\phpwamp\apache\bin\httpd -k install

Démarrage du service Apache

C:\phpwamp\apache\bin\httpd -k start

Redémarrage du service Apache

C:\phpwamp\apache\bin\httpd -k restart

Moniteur Apache (icone dans la barre de notification)

C:\phpwamp\apache\bin\ApacheMonitor.exe

Vérification du serveur. Fichier index.php
<?php
echo phpinfo();
?>

MySQL

Pour accéder à MySQL en ligne de commande :

  • fenêtre DOS ;
  • mysql -u root -p

Sauvegarde d'une base de données :

  • mysqldump --databases nombase > nombase-sauv.sql

Import d'une base :

  • mysql -u root -p nombase < nombase-sauve.sql

Kono installation (MediaWiki)

  1. langue : français
  2. vérification environnement
    • Attention : impossible de trouver APCu ou WinCache ;
    • Attention : votre répertoire par défaut pour les téléversements, C:\phpwamp\www\konoRH/images/, est vulnérable, car il peut exécuter n’importe quel script.
  3. Connexion à la base de données
    • hôte base de données : localhost
    • nom base : konorh
    • préfixe tables : konorh
    • compte pour l'installation
  4. paramètres de la base de données
    • compte de la base de données pour l'accès web
  5. nom
    • Kono RH
    • compte administrateur
  6. Options
    • wiki privé
    • aucune licence
    • pas de courriel
    • habillage Vector
    • ...
    • Téléversement des images et des fichiers

Kono personnalisation

Extensions

PdfHandler : affichage de PDF

Nécessite les outils suivants :

Pour ImageMagick, avec la version ImageMagick-7.1.0-Q16, j'ai dû faire une copie du fichier magick.exe et la renommer en convert.exe ; avec cette action, l'outil fonctionne bien !

Ajout des chemins suivant au chemin système (PATH) :

  • C:\phpwamp\outil\gs\bin\
  • C:\phpwamp\outil\ImageMagick-7.1.0-Q16\
  • C:\phpwamp\outil\xpdf-tools-win-4.03\bin64\
# PdfHandler, options
$wgPdfProcessor = 'C:\phpwamp\outil\gs\bin\gswin64.exe';
# $wgPdfPostProcessor = $wgImageMagickConvertCommand; // if defined via ImageMagick
$wgPdfPostProcessor = 'C:\phpwamp\outil\ImageMagick-7.1.0-Q16\convert.exe'; // if not defined via ImageMagick
$wgPdfInfo = 'C:\phpwamp\outil\xpdf-tools-win-4.03\bin64\pdfinfo.exe';
$wgPdftoText = 'C:\phpwamp\outil\xpdf-tools-win-4.03\bin64\pdftotext.exe';

LdapAuthentication

Auth remoteuser

NoTitle, pour ne pas afficher le titre de l'article

Habillage

Utilisation de l'habillage Pivot