Difference between revisions of "Mediawiki"
From Jon's Wiki
Line 1: | Line 1: | ||
+ | == Installation == | ||
+ | |||
+ | This assumes Ubuntu 14.04 LTS, Mediawiki version ≥ 1.24 and a passing familiarity with [[Git]]. First, clone the core code into the target directory: | ||
+ | |||
+ | git clone <nowiki>http://gerrit.wikimedia.org/r/p/mediawiki/core.git</nowiki> mediawiki | ||
+ | |||
+ | Clone the extensions and skins. These are tracked in hundreds of separate git repositories (here, we clone the root and use git submodules to manage them): | ||
+ | |||
+ | git clone <nowiki>https://gerrit.wikimedia.org/r/mediawiki/skins</nowiki> skins-available | ||
+ | cd skins-available | ||
+ | git submodule init | ||
+ | cd .. | ||
+ | |||
+ | git clone <nowiki>https://gerrit.wikimedia.org/r/mediawiki/extensions</nowiki> extensions-available | ||
+ | cd extensions-available | ||
+ | git submodule init | ||
+ | cd .. | ||
+ | |||
+ | Now when we want an extension, say the ''Cite'' extension, we can: | ||
+ | |||
+ | cd extensions-available | ||
+ | git submodule update --recursive Cite | ||
+ | cd ../mediawiki/extensions | ||
+ | ln -s ../../extensions-available/Cite0 | ||
+ | |||
+ | TODO: tbc... catchy-bussy | ||
+ | |||
== Caching == | == Caching == | ||
Revision as of 05:38, 13 July 2015
Installation
This assumes Ubuntu 14.04 LTS, Mediawiki version ≥ 1.24 and a passing familiarity with Git. First, clone the core code into the target directory:
git clone http://gerrit.wikimedia.org/r/p/mediawiki/core.git mediawiki
Clone the extensions and skins. These are tracked in hundreds of separate git repositories (here, we clone the root and use git submodules to manage them):
git clone https://gerrit.wikimedia.org/r/mediawiki/skins skins-available cd skins-available git submodule init cd .. git clone https://gerrit.wikimedia.org/r/mediawiki/extensions extensions-available cd extensions-available git submodule init cd ..
Now when we want an extension, say the Cite extension, we can:
cd extensions-available git submodule update --recursive Cite cd ../mediawiki/extensions ln -s ../../extensions-available/Cite0
TODO: tbc... catchy-bussy
Caching
PHP opcache
Like any PHP application, use the opcache. If your PHP version is < 5.5 install php5-xcache, otherwise enable the built-in opcache by adding this in php.ini:
[opcache] opcache.enable=1 opcache.enable_cli=1 opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.use_cwd=1 opcache.validate_timestamps=1 opcache.revalidate_freq=0 opcache.fast_shutdown=0
MediaWiki file cache
Use the file cache, Luke. It's simple but effective. In LocalSettings.php:
$wgUseFileCache = true; $wgFileCacheDirectory = "/var/cache/mediawiki"; $wgShowIPinHeader = false;
And create the appropriate cache directory:
sudo mkdir -p /var/cache/mediawiki sudo chown www-data:www-data /var/cache/mediawiki