Manual:Running MediaWiki on Ubuntu/fr

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Running MediaWiki on Debian or Ubuntu and the translation is 4% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎polski • ‎русский • ‎中文 • ‎日本語 • ‎한국어


Guides d'installationManual:Installation guide
FreeBSDManual:Running MediaWiki on FreeBSD
GNU/LinuxManual:Running MediaWiki on GNU/Linux
- ALT LinuxManual:Running MediaWiki on ALT Linux
- Arch LinuxManual:Running MediaWiki on Arch Linux
- DamnsmalllinuxManual:Running MediaWiki on Damnsmalllinux
- Debian or UbuntuManual:Running MediaWiki on Debian or Ubuntu
- FedoraManual:Running MediaWiki on Fedora
- GentooManual:Running MediaWiki on Gentoo Linux
- MandrivaManual:Running MediaWiki on Mandriva
- Red Hat Enterprise LinuxManual:Running MediaWiki on Red Hat Linux
- SlackwareManual:Running MediaWiki on Slackware Linux
Mac OS XManual:Running MediaWiki on Mac OS X
NetWareManual:Running MediaWiki on NetWare
SolarisManual:Running MediaWiki on Solaris
- Solaris 11 / opensolarisManual:Running MediaWiki on Solaris 11 / opensolaris
- Solaris 10Manual:Running MediaWiki on Solaris 10
WindowsManual:Running MediaWiki on Windows
- Windows Server 2016Manual:Installing MediaWiki on Windows Server 2016
sur un stickManual:Wiki on a stick
- Uniform ServerManual:Installation on Uniform Server (Windows)
- XAMPPManual:Installing MediaWiki on XAMPP
Sourceforge.netManual:Installing MediaWiki on SourceForge.net
This page documents how to install MediaWiki using the release tarballs. If you want to use system packages, see User:Legoktm/Packages.

Cette page décrit, de la façon la plus détaillée possible, la procédure à mettre en oeuvre pour installer sur votre ordinateur personnel ( testé avec Ubuntu 6.10 Desktop ) une version locale d'un site de la fondation wikimedia, ce qui permet de consulter le-dit site sans être connecté à Internet.

The instructions below refer to Debian, but unless otherwise noted also apply to Ubuntu and Raspbian.

Introduction

This installation procedure requires knowledge of issuing commands from a terminal (e.g. installing applications) and using a text editor (e.g. graphical: gedit, kate; text: nano, emacs, vi).

When text editing is required it can be carried out on the graphical desktop by pressing Alt-F2 and typing

    gksudo gedit filename

Alternatively, editing can be done from a terminal

    sudo nano filename

Of course, kate could be used instead of gedit or vi instead of nano.

Etape par Etape

Ensure Debian is up-to-date

Double check that Debian is up-to-date by running:

sudo apt-get update
sudo apt-get upgrade

or in one line

sudo apt-get update && sudo apt-get upgrade


Installer le serveur LAMP

Pour installer le serveur LAMP il est possible de se reporter à l'excellent tutoriel disponible ici ,

During the installation step, make sure you choose to install a LAMP server.

après avoir suivi ce tutoriel les différents composants nécessaires seront installés notamment :

Ubuntu 16.04.2 LTS (Xenial) and Debian Stretch include PHP 7.0, and renamed many packages from "php5" to plain "php". In addition, some PHP modules are now in separate packages (xml, mbstring).
sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring
Ubuntu Trusty, Debian Jessie and Raspbian (Jessie) include PHP 5, and use "php5" in most (but not all) packages.
sudo apt-get install apache2 mysql-server php5 php5-mysql libapache2-mod-php5

Optional useful packages

These packages are not necessary but may be useful, depending on the installation:

Name Package Description
Alternative PHP Cache php-apcu or php5-apcu Modern MediaWiki versions will automatically take advantage of this being installed for improved performance.
PHP Unicode normalization php-intl or php5-intl MediaWiki will fallback to a slower PHP implementation if not available.
ImageMagick imagemagick Image thumbnailing.
Inkscape inkscape Alternative means of SVG thumbnailing, than ImageMagick. Sometimes it will render SVGs better if originally created in Inkscape.
PHP GD library php-gd or php5-gd Alternative to ImageMagick for image thumbnailing.
PHP command-line php-cli or php5-cli Ability to run PHP commands from the command line, which is useful for debugging and running maintenance scripts.
PHP cURL php-curl or php5-curl Required by some extensions such as Extension:Math. See Manual:cURL
git source control version git If not present config script will tell you that it is not installed

You can install any of the above with sudo apt-get install packagename.

If you want to install all of them: sudo apt-get install php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl git If you install php-apcu you will have to reload your apache configuration in order to avoid a warning message when running configuration script:

sudo service apache2 reload

Get MediaWiki

This can be done from a browser or by command line

    cd /tmp/
    wget https://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.1.tar.gz
  • extract in your Web directory
tar -xvzf /tmp/mediawiki-*.tar.gz
sudo mkdir /var/lib/mediawiki
sudo mv mediawiki-*/* /var/lib/mediawiki


Configuration mysql

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

You will have to:

  • create a NEW mysql user (new_mysql_user):
# sudo mysql -u root -p and enter password of mysql root user (if you have no configured password it will be empty, so just press return)
mysql> CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';
mysql> quit;
  • create a NEW mysql database pi_wiki:
# sudo mysql -u root
mysql> CREATE DATABASE pi_wiki;
mysql> use pi_wiki;
Database changed
  • GRANT the NEW mysql user access to the NEW created mysql database pi_wiki:
mysql> GRANT ALL ON pi_wiki.* TO 'new_mysql_user'@'localhost';
Query OK, 0 rows affected (0.01 sec)
mysql>quit;

Optional: Configure PHP

These steps are optional and can be done post-installation. MediaWiki will still work without these changes.

Edit your PHP configuration file, php.ini. On Ubuntu Trusty and Debian Jessie, it is located at /etc/php5/apache2/php.ini.

On Ubuntu Xenial and Debian Stretch (PHP 7), it is located at /etc/php/7.0/apache2/php.ini.

Maximum upload file size

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:

upload_max_filesize = 2M

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

Memory limit

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

memory_limit = 8M

to

memory_limit = 128M

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

Additional wiki configuration

General information

Mediawiki is configured by the LocalSettings.php file, usually found in /var/lib/mediawiki. Manual:LocalSettings.php 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


File uploads

See Manuel:Configuration du téléversement de fichiersManual:Configuring file uploads.

See Manuel:$wgLogoManual:$wgLogo.

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 Manual:Extensions#Installing an extensionManual:Extensions#Installing an extension.

Pretty URLs

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

Voir aussi