Introduction
MediaWiki is a free, open-source wiki software, the same platform used by Wikipedia. It operates dynamically on a LAMP stack, leveraging PHP and MySQL for its backend. With straightforward installation and configuration, MediaWiki is an excellent choice for a fully-featured dynamic wiki engine.
Requirements
You need a user with sudo privileges (root is also fine) and a server with Apache, PHP, and MySQL installed.
For guidance on creating a new user with sudo privileges, refer to the provided tutorial.
This tutorial uses Ubuntu 16.04, but the steps are applicable to other Ubuntu and Debian versions as well.
In VPS Sell, installing the Ubuntu 16.04 template is quick and simple:
- Log in to the Client Area.
- Go to "My Services > VPS" at the top menu.
- Click the "Manage" button in the service table.
- Click the "Install OS" button.
- Select Ubuntu 16.04, agree to the warning, and click "Continue."
- Wait 5-10 minutes and refresh the VPS management page.
Step 1: Updating the System
- Update and upgrade your server:
apt-get update
apt-get upgrade -y
Step 2: Install LAMP Stack
- Install Apache, PHP, and MySQL (LAMP) stack using tasksel:
sudo apt install tasksel
sudo tasksel install lamp-server
Step 3: Installing MediaWiki
Download the latest MediaWiki package from the MediaWiki homepage.
Navigate to the web-accessible DocumentRoot:
cd /var/www/html/
Download the package using wget
:
wget https://releases.wikimedia.org/mediawiki/1.30/mediawiki-1.30.2.tar.gz
Decompress the package:
tar -xvzf mediawiki-1.30.2.tar.gz
Move and rename the directory:
mv mediawiki-1.30.2 mediawiki
Change permissions for the config directory:
cd mediawiki
chmod a+w mw-config
Install and enable the mbstring and XML extensions:
apt-get install php-mbstring php-xml -y
service apache2 restart
Step 4: Configuring MediaWiki
Open your browser and navigate to your_domain/mediawiki
. Click on the “Please set up the wiki first” link to start the setup process.
Enter the required information such as database name, username, and password.
After completing the installation form, you’ll be prompted to download a file. Save or open this file.
Return to your VPS via SSH and create the LocalSettings.php file:
nano /var/www/html/mediawiki/LocalSettings.php
Copy the contents of the downloaded file into LocalSettings.php and save it.
Restrict access to the LocalSettings.php file:
chown root:www-data /var/www/html/mediawiki/LocalSettings.php
chmod 640 /var/www/html/mediawiki/LocalSettings.php
Conclusion
MediaWiki is now successfully installed and configured. You have a powerful and user-friendly wiki engine ready for use.