Manual:Running MediaWiki on Debian or Ubuntu/fr

Cette page explique comment installer MediaWiki sur un serveur Debian ou Ubuntu GNU/Linux. Les instructions ci-dessous font référence à Debian, mais sauf indication contraire, s'appliquent également à Ubuntu et Raspbian.

Introduction
Cette procédure d'installation nécessite la connaissance de l'émission de commandes à partir d'un terminal (par exemple, l'installation d'applications) et l'utilisation d'un éditeur de texte (par exemple graphique: gedit, kate; texte: nano, emacs, vi).

Lorsque l'édition de texte est requise, elle peut être effectuée sur le bureau graphique en appuyant sur Alt-F2 et en tapant

gksudo gedit nom de fichier

Alternativement, l'édition peut être effectuée à partir d'un terminal

sudo nano nom de fichier

Bien sûr, kate pourrait être utilisé à la place de gedit ou vi/emacs au lieu de nano.

S'assurer que Debian est à jour
Vérifiez que Debian est à jour en exécutant:

or in one line

Installer le serveur LAMP
Ubuntu Server Edition rend LAMP (Apache, PHP et MySQL) disponible pour l'installation pendant le processus d'installation. Lors de l'étape d'installation, assurez-vous de choisir d'installer un serveur LAMP. Vous pouvez également installer tous ces packages à partir d'une installation standard à l'aide de ces commandes :

Paquets utiles facultatifs
Ces packages ne sont pas nécessaires mais peuvent être utiles, en fonction de l'installation:

Vous pouvez installer l'un des éléments ci-dessus avec.

Si vous souhaitez les installer tous :

If you install php-apcu you will have to reload your apache configuration in order to avoid a warning message when running configuration script:

Obtenir MediaWiki

 * Download the official tarball

This can be done from a browser or by command line

cd /tmp/ wget https://releases.wikimedia.org/mediawiki//mediawiki-.tar.gz


 * extract in your Web directory

Configurer MySQL
But before proceeding with the initial MediaWiki installation, there are certain steps you need to do first!

On Raspbian, if this is a new installation of mariadb you will also need to run. sudo mysqld_safe --skip-grant-tables --skip-networking &

You will have to:


 * create a NEW mysql user (new_mysql_user):

# sudo mysql -u root -p Enter password: Enter password of mysql root user (if you have not configured password it will be blank, so just press enter) mysql> CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED'; mysql> quit;


 * create a NEW mysql database my_wiki:

# sudo mysql -u root -p mysql> CREATE DATABASE my_wiki; mysql> use my_wiki; Database changed


 * GRANT the NEW mysql user access to the NEW created mysql database my_wiki:

mysql> GRANT ALL ON my_wiki.* TO 'new_mysql_user'@'localhost'; Query OK, 0 rows affected (0.01 sec) mysql> quit;

Facultatif : Configurez PHP
Edit your PHP configuration file,. It is located at, depending on exact version of PHP.

Taille maximale du fichier de téléchargement
Assuming that various files are going to be uploaded to the Wiki as content, the limit on the maximum size of an upload has to be adjusted. About one-half way down is the File Uploads section. Change:

to at least 20M. You may have to adjust this again in the future if you want bigger uploads.

Limite de mémoire
Some PHP scripts require a lot of memory to run. To increase the maximum amount of memory a script can use, page down to about 21%, and change the following entry, if found, from

to

If it is already set to 128M or more, leave it as is.

Configurer Mediawiki
Navigate your browser to http://localhost/mediawiki (for certain installations it may be http://localhost/mediawiki/config or http://wiki.hostname.com/config instead) and following the procedure given.

If this gives a 404 error then working a symbolic link should solve it:

sudo ln -s /var/lib/mediawiki /var/www/html/mediawiki


 * Pay close attention for "Checking environment..." in MediaWiki installation script.

This can solve a lot of problems by specifically identifying the source of any errors.

It may complain that php extensions like mbstring and xml are missing even you have installed them. Please manually activate them by using:

sudo phpenmod mbstring sudo phpenmod xml sudo systemctl restart apache2.service

Fill out all the field in the configuration form and press to continue button. You will have to use your username and password provided in the mysql configuration section:

mysql> CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';

Under Database Config, you may change the database name and DB username to new values, but you must turn on "Use superuser account", name:

debian-sys-maint

giving the mysql root password you configured earlier.

The configuration process will prompt you to download a LocalSettings.php that must be saved to the parent directory of the new wiki. The configuration page will give the exact directory/filename that must be moved:

sudo mv ~/Downloads/LocalSettings.php /var/lib/mediawiki/

And navigate your browser to http://localhost/mediawiki (or http://server_ip_address/mediawiki or  http://server_ip_address/mediawiki/index.php) to see your new wiki.

Done! You now have a working Wiki

Informations générales
MediaWiki is configured by the LocalSettings.php file, usually found in. has detailed information that may be useful. The following are changes that appear to be universally helpful

To edit LocalSettings.php use

gksudo gedit /var/lib/mediawiki/LocalSettings.php

or from a terminal

sudo nano /var/lib/mediawiki/LocalSettings.php

Téléchargements de fichiers
Voir.

Changer le logo
Voir.

MediaWiki extensions
The current tarball for MediaWiki comes with a package of 15 or so of the most popular extensions, but there are literally hundreds more.

Instructions on how to enable extensions can be found at.

Pretty URLs
To use /wiki/* instead of /wiki/index.php/* on Debian, follow the recommended short URL guide using  as the script path instead of   and placing the rewrites in /etc/apache2/conf-enabled/mediawiki.conf.

Voir aussi

 * Canonical maintains a MediaWiki page with more information
 * Page Debian MediaWiki
 * Ubuntuguide.org fournit des instructions détaillées pour configurer MediaWiki sur Ubuntu et Kubuntu, y compris plusieurs wikis et sous-wikis imbriqués.
 * Du début à la fin Guide de configuration de Mediawiki sur ofswiki.org, faisant référence étroitement aux documents officiels, prise en charge de plusieurs distributions, y compris Debian/Ubuntu, l'automatisation et un style minimal