Wikis are a unique type of website where users can collaboratively add information to a web page from a web browser. MediaWiki is the wiki software that powers Wikipedia, other Wikimedia Foundation Wikis, and various other sites. As MediaWiki is free, well tested, and kept up to date by the Wikimedia Foundation and other open source collaborators, it is a great choice for a medium-sized wiki or larger.
However, in order for MediaWiki to run at its fullest capabilities in larger scale environments, certain special configurations and extensions are necessary. This guide aims to describe the MediaWiki installation process the way this with the addition of these components.
MediaWiki runs in a variety of systems, but a server as configured here should use a Linux system. The Linux Distributions Debian/Ubuntu 16.04 and RHEL/CentOS 7 are explicitly supported here. This guide does not support Windows, though a BSD UNIX might work.
While a home server could work for personal use, consider using a hosted instance like the DigitalOcean or Amazon AWS, which provides greater reliability and explicitly allows website hosting, whereas home connections may have restrictions on such activity.
The basic configuration for an optimized MediaWiki instance.
- Web Server: Nginx/MediaWiki – Nginx is used in place of Apache for its greater effectiveness with static content and SSL support.
- PHP Engine: HHVM – HHVM was created by Facebook as a Just-in-Time compiling virtual machine that provides higher performance for PHP programs like MediaWiki.
- PHP-FPM - Alternatively, you could use PHP-FPM with MediaWiki, since HHVM only supports 64-bit Intel/AMD platforms.
- SQL Database: MariaDB/PostgreSQL – Either of these SQL databases will work, but MariaDB is used most often by the Wikimedia Foundation and has best compatibility with extensions.
- Wiki Software: MediaWiki/Deployment – MediaWiki is used as the wiki software. It is set up after the web server, PHP engine, and SQL Database.
- Cache: Memcached – Caches significantly lighten the load on the SQL database, and memcached is particularly easy to set up.
Additional configurations that can be added once the wiki increases in usage. You can look up how to set these up online.
- Job Queue: Redis – The Job Queue can also be cached to reduce database load.
- Dynamic Caching Server: Varnish – Wikimedia servers utilize this caching front server to significantly reduce the regeneration that dynamic pages need.
- Content Delivery Network: Cloudflare – Reduce the threat of DDoS attacks with a load balancing Content Delivery Network.
Follow this guide first, but then the distribution specific ones for further guidance and dependencies.
For Debian, although there exists a Mediawiki package in jessie-backports, it installs Apache and MySQL, which is not what we use. But if you're fine with that, go ahead.
sudo yum -y install ImageMagick php72w-fpm php72w-intl php72w-xml php72w-curl php72w-gd php72w-mbstring php72w-mysql php72w-cli php72w-pear php72w-pecl-apcu
Set up Nginx