This is an old revision of the document!
Mediawiki
The Wikimedia foundation Wiki.
Setup
MySQL
CREATE DATABASE mediawiki CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; CREATE USER 'mediawiki'@'X.X.X.X' IDENTIFIED BY 'mediawiki'; GRANT ALL ON mediawiki.* TO 'mediawiki'@'X.X.X.X' WITH GRANT OPTION; FLUSH PRIVILEGES;
NGINX
Install
PHP composer
apt install composer composer -V Composer version 2.5.5 2023-03-21 11:50:05
PHP8 APCu
apt install php-pear php-dev pecl install APCu echo "extension=apcu.so" >> /etc/php/8.2/mods-available/local.ini ln -sf /etc/php/8.2/mods-available/local.ini /etc/php/8.2/fpm/conf.d/10-local.ini
Wiki
mkdir -p /var/www/htdocs/www.example.com cd /var/www/htdocs/www.example.com wget "https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.0.zip" unzip mediawiki-1.43.0.zip mv mediawiki-1.43.0 w chown -R www-data:www-data w
Settings
Visit the wiki site and follow the installation procedure which will conclude with a download of the LocalSettings.php file.
Edit the settings file and upload to the server and installation is complete.
$wgGroupPermissions['*']['createaccount'] = false; wfLoadExtension('Nuke');
Language
During installation the locale may be set to “en-gb” (or something else) and it's preferable to use “en”.
“en” is the default language and when searching for an item with an un-associated language.
There is no known option to change this default to “en-gb” (or whatever else).
Add the following to LocalSettings.php
$wgLanguageCode = "en";
Now clear and reset the language to “en”.
echo 'MediaWiki\MediaWikiServices::getInstance()->getMessageCache()->clear()' | php maintenance/run.php eval php maintenance/run.php userOptions.php language --old en-GB --new en
To disable internationalisation in user preferences, add the following to LocalSettings.php
$wgHiddenPrefs[] = 'language';