Manual:Running MediaWiki on Windows Subsystem for Linux/fr

Cette documentation permet d'exécuter sous Windows 10 avec WSL (Windows Subsystem for Linux). Voir pour la documentation sur l'exécution de MediaWiki directement sous Windows.

Contexte
Windows 10 inclut un niveau de compatibilité avec Linux, le sous-système Windows pour Linux, conçu pour aider les développeurs web qui ont besoin d'un environnement de développement Linux/Unix sur un ordinateur Windows. Ceci peut être utilisé pour exécuter MediaWiki comme si on était sur une machine Linux, avec moins de surcharge et une meilleure integration, comparé à la configuration et l'exécution d'une machine virtuelle.

Ceci peut en faire une bonne solution pour les ordinateurs Windows 10 ayant une RAM et des ressources CPU limitées. Néanmoins WSL nécessite une édition 64-bits de Windows 10 (x64 ou ARM64), et ne peut pas s'exécuter sur les installations x86 32-bit de  Windows 10.

Notes de sécurité
MediaWiki is a web application, and following these directions will set up a web server that runs on your computer and can be exposed to other computers on the network. In particular, note that PHP and other Linux code running in the web server may have access to your Windows  drive and may be able to read or modify files or run Windows programs.

It is strongly recommended to use this for development purposes only, not for server deployments, and to limit network access to the web server to avoid accidentally opening anything to the network. N'exécutez MediaWiki qu'avec les extensions en lesquelles vous avez confiance.

Versions WSL
There are two major versions of WSL available: the original which emulates the Linux kernel ABI as a Windows driver, and the newer WSL2 which uses a specialized Hyper-V virtual machine to run a native Linux kernel. The original WSL1 is available on Windows 10 version 1709 to 1909 and is likely to have problems trying install to mysql-server. The May 2020 Update upgrades to WSL 2.

WSL2 is compatible with more software, but can complicate some integration scenarios a little as the VM has its own IP address separate from. (Servers are port-forwarded to, so this mostly works ok for setting up a web server.)

Note that WSL2 requires hardware support for virtualization and uses Hyper-V under the hood, but is available on Windows 10 Home as well as Windows 10 Pro. This will make it easier for developers to install on existing machines without spending money on a Pro upgrade, but may have compatibility problems with other VM software like VirtualBox. WSL1 doesn't require virtualization.

Configuration

 * Go to Control Panel, Programs and Features, then the link on the left side Turn Windows features on or off, or run C:\Windows\System32\OptionalFeatures.exe.
 * Check "Windows Subsystem for Linux" and, for WSL2, "Virtual Machine Platform"
 * let it install and reboot
 * Go to 'Microsoft Store' and search for the latest "Ubuntu" Linux distribution
 * install it!
 * Debian is also available, but might be slightly different in some respects.
 * Click on the "Ubuntu" icon in Start menu or enter  from a PowerShell session, (notice how the prompt changes from Windows to Linux style).
 * follow the on-screen prompts about setting up a Linux username and password
 * let it extract

Configuration de WSL
To use WSL2 mode, exit and run in a PowerShell session:



This may take a few minutes to convert filesystems.

To verify which version of WSL is in use do:



Configuration des dépendances
First, ensure the system image is up to date: run  in the Ubuntu terminal. This may take a few minutes after first installation.

Install deps:

Services démarrés
You may have to manually start up services:


 * on WSL1 this may prompt Windows Firewall about the listening port. Allow it, but consider limiting to "private" networks for safety.
 * on WSL1 this may prompt Windows Firewall about the listening port. Allow it, but consider limiting to "private" networks for safety.
 * on WSL1 this may prompt Windows Firewall about the listening port. Allow it, but consider limiting to "private" networks for safety.

You may have to jump through some hoops to set the root password on mysql:


 * Run mysql as root:
 * In the mysql terminal run:
 * - If that fails try  instead.
 * - This must match with the wiki database in the install process
 * Now you can use username 'root', password 'your-password-here' when logging in from the installer
 * - This must match with the wiki database in the install process
 * Now you can use username 'root', password 'your-password-here' when logging in from the installer
 * Now you can use username 'root', password 'your-password-here' when logging in from the installer
 * Now you can use username 'root', password 'your-password-here' when logging in from the installer
 * Now you can use username 'root', password 'your-password-here' when logging in from the installer
 * Now you can use username 'root', password 'your-password-here' when logging in from the installer

Configuration de MediaWiki
Clone things from git as you would on a Linux server.

Apache on Ubuntu is set by default to point at  for the docroot, you can create a dir under there to check out or reconfigure Apache with a custom path. I recommend  for consistency with convention that   is the main script path.


 * - Don't miss the dot at the end.
 * - Don't miss the dot at the end.
 * - Don't miss the dot at the end.
 * - Don't miss the dot at the end.
 * - Don't miss the dot at the end.

If git has trouble checking out over https, use a ssh developer login. Set up your SSH key in gerrit as with a Linux system, and check out as:

Extensions
For example (from skins/):



Don't forget to run  in the MW directory, and for any extension dirs that require it.

Run the web installer in a browser at  Use your name and database here for installation.

When the installer prompts you to download  at the end, save it into   or equivalent and you will be able to access your wiki!

File des tâches
You may want or need to manually run the job queue runner. Ideally this should be done via the web server, but in a pinch you can fire up the Ubuntu terminal and run:



Autre configuration
For the most part the WSL environment will look like any other Ubuntu or Debian system, except that services won't automatically start and must be manually run on every boot. See Manual:Running MediaWiki on Debian or Ubuntu for general instructions on running on these operation systems.

Modifier les fichiers
From the Windows side you can access Linux files in, so Windows text editors that are ok with Unix line endings can be used to work with your code and config.

Visual Studio Code also has a WSL remoting extension which can integrate more directly with the WSL environment, which might be good for using PHP linting in the editor.

However note the warnings at Do not change Linux files using Windows apps and tools

Or, you can use your favorite terminal-based editors.

Problèmes ouverts

 * is the process timeout issue in TimedMediaHandler a common prob or unique to ARM64? (test me)