How to Install MediaWiki 1.42.0 on a Ubuntu

If you want to install MediaWiki on Ubuntu, this guide will help you get started. MediaWiki is a free and open-source wiki software package that can be used to create and manage online information. It’s an excellent tool for developing and managing your website or blog.

This is a guide to installing MediaWiki on Ubuntu from scratch. this video shows you how to install all the prereqs, configure the database, PHP settings, and everything to get the Wiki loading in your web browser.

Install MediaWiki

How to Install MediaWiki on Ubuntu: A Detailed Procedure

MediaWiki is a free and open-source software that powers Wikipedia and many other websites. This guide provides a step-by-step procedure for installing MediaWiki on an Ubuntu server. The guide assumes that you have a basic understanding of Linux commands and have sudo privileges on the server.

Install MediaWiki Pre-requisites

  1. Ubuntu Server: A running instance of Ubuntu (18.04 or later is recommended).
  2. SSH Access: Secure Shell (SSH) access to your Ubuntu server.
  3. LAMP Stack: Linux, Apache, MySQL, and PHP installed on your server.

Step 1: Update Ubuntu Packages

Firstly, update the package list and upgrade the installed packages to their latest versions.

Bash
sudo apt update -y
sudo apt upgrade -y  #You can optionally upgrade the OS

Step 2: Install Apache Web Server

If Apache is not already installed, you can install it using the following command:

Bash
sudo apt install apache2 -y

Step 3: Install MySQL Database Server

Install MySQL by executing the following command:

Bash
sudo apt install mysql-server -y

Step 4: Secure MySQL Installation

Run the MySQL security script to secure your database.

Bash
sudo mysql_secure_installation

Follow the prompts to set a root password and secure your MySQL installation.

Step 5: Install PHP

MediaWiki requires PHP to function. Install PHP and some additional modules with the following command:

Bash
sudo apt install php php-mysql php-xml php-mbstring -y

Step 6: Download and Install MediaWiki

Navigate to the web root directory and download the latest version of MediaWiki.

You can check the latest version by browsing here.

Bash
cd /var/www/html 
wget https://releases.wikimedia.org/mediawiki/1.42/mediawiki-1.42.0-rc.0.tar.gz

Step 7: Extract MediaWiki Archive

Extract the downloaded tarball and move the contents to a new directory.

Bash
tar xzvf mediawiki-*.tar.gz mv mediawiki-1.42.0-rc.0/* /var/www/html/

Step 8: Create a MySQL Database

Log in to MySQL and create a new database for MediaWiki.

Bash
mysql -u root -p 
CREATE DATABASE mediawiki; 
GRANT ALL PRIVILEGES ON mediawiki.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'password'; 
FLUSH PRIVILEGES; 
EXIT;

Step 9: Run Install MediaWiki Script

Open a web browser and navigate to http://your_server_ip/. Follow the on-screen instructions to complete the MediaWiki installation.

Step 10: Configure Apache

Finally, configure your Apache server to serve the MediaWiki site. Edit the Apache configuration file as needed.

Advanced Customization and Integration of MediaWiki on Ubuntu

Once you’ve successfully installed MediaWiki on your Ubuntu server, you may want to explore advanced customization options and integration with other software to enhance its capabilities. This guide will walk you through some of these advanced steps.

Customizing MediaWiki Appearance

Install Themes

  1. Download Theme: Download your desired MediaWiki theme from the MediaWiki Skins directory.
  2. Upload to Server: Upload the theme folder to /var/www/html/skins/ on your server.
  3. Edit LocalSettings.php: Open the LocalSettings.php file and add the following line to activate the theme:

Bash
wfLoadSkin('YourThemeName');

Customize Logo

  1. Upload Logo: Upload your custom logo to /var/www/html/resources/assets/.
  2. Edit LocalSettings.php: Add the following line to change the logo

Bash
$wgLogo = "$wgResourceBasePath/resources/assets/your_logo.png";

Extending MediaWiki Functionality

Install Extensions

  1. Download Extension: Download your desired extension from the MediaWiki Extensions directory.
  2. Upload to Server: Upload the extension folder to /var/www/html/extensions/.
  3. Activate Extension: Open LocalSettings.php and add the following line

Bash
wfLoadExtension('YourExtensionName');

Integration with Other Software

LDAP Integration

  1. Install LDAP Extension: Follow the steps above to install the LDAP Authentication extension.
  2. Configure LDAP: Add the LDAP configuration to your LocalSettings.php file. This will include the LDAP server details and user credentials.

Visual Editor

  1. Install Parsoid: Visual Editor requires Parsoid to run. Install it using:

Bash
sudo apt install parsoid

  1. Configure Parsoid: Edit the Parsoid settings to point it to your MediaWiki API.
  2. Activate Visual Editor: Install and activate the Visual Editor extension as described above.

Backup and Restore

Backup

  1. Backup Database: Use mysqldump to backup your MediaWiki database.

Bash
mysqldump -u root -p mediawiki > mediawiki_backup.sql 

Backup Files: Archive the MediaWiki installation directory.

Bash
tar czvf mediawiki_files_backup.tar.gz /var/www/html/

Restore

Restore Database: Use mysql to restore the database

Bash
mysql -u root -p mediawiki < mediawiki_backup.sql

Restore Files: Extract the archived files back into the MediaWiki installation directory.

Advanced customization and integration can significantly extend the capabilities of your MediaWiki installation. Whether you’re looking to change the appearance, add new features, or integrate with other platforms, these steps offer a solid foundation.

Install MediaWiki: Your Questions Answered

Q: How do I install MediaWiki?

A: Installing MediaWiki involves several steps:

  1. Check System Requirements: Ensure your server meets the minimum requirements (web server, PHP, database).
  2. Download MediaWiki: Get the latest version from the official MediaWiki website.
  3. Set Up Database: Create a database and user for MediaWiki to use.
  4. Upload Files: Transfer the MediaWiki files to your web server.
  5. Run the Installation Script: Access the installation script through your web browser and follow the prompts.
Elsewhere On TurboGeek:  Essential Google Cloud Shell Commands: A Quick Reference

Q: Can I install MediaWiki on my own computer?

A: Yes! You can install MediaWiki locally on your computer for testing or personal use. You’ll need to set up a local web server (like XAMPP or WAMP) and database.

Q: Is there an easy way to install MediaWiki?

A: Many web hosting providers offer one-click installs or automated installers for MediaWiki, simplifying the process. If you’re not comfortable with manual installation, this could be a good option.

Q: What are the best practices for installing MediaWiki?

A: Here are some tips for a successful installation:

  • Keep Software Updated: Use the latest versions of MediaWiki, PHP, and your database software for security and performance.
  • Secure Your Wiki: Set up strong passwords, restrict access where necessary, and consider using HTTPS.
  • Customize Your Wiki: Explore MediaWiki’s many extensions and themes to personalize your wiki’s appearance and functionality.

Q: Where can I find detailed installation instructions?

A: The official MediaWiki website offers comprehensive installation manuals:

Q: What if I get stuck during installation?

A: Don’t worry! There are several resources to help you:

  • MediaWiki Community: Ask for help on the MediaWiki forums or mailing lists.
  • Web Hosting Support: If you’re using a web host, contact their support for assistance.
  • Professional Help: Consider hiring a developer or system administrator to help with the installation.

Richard.Bailey

Richard Bailey, a seasoned tech enthusiast, combines a passion for innovation with a knack for simplifying complex concepts. With over a decade in the industry, he's pioneered transformative solutions, blending creativity with technical prowess. An avid writer, Richard's articles resonate with readers, offering insightful perspectives that bridge the gap between technology and everyday life. His commitment to excellence and tireless pursuit of knowledge continues to inspire and shape the tech landscape.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate ยป