Introduction

MediaWiki is a free and open-source wiki software that powers websites like Wikipedia. In this guide, we will show you how to install and configure MediaWiki on a Windows VPS.

Prerequisites

Before you begin, ensure that you have the following:

  • A Windows VPS with administrative privileges.
  • Windows Server 2016 or later, or Windows 10/11 installed.
  • PHP, Apache, and MySQL (or MariaDB) installed on your Windows VPS.
  • Basic knowledge of the command line and web server management.

Step 1: Install Apache, PHP, and MySQL on Your Windows VPS

If you don’t have Apache, PHP, and MySQL installed, follow these steps:

  1. Download and install Apache HTTP Server.
  2. Download and install the latest version of PHP.
  3. Download and install MySQL or MariaDB.
  4. Ensure all services are running and configured correctly by testing each one via the command line or by visiting their respective web interfaces.

Step 2: Download MediaWiki

To download MediaWiki, follow these steps:

  1. Visit the official MediaWiki download page.
  2. Download the latest stable release of MediaWiki.
  3. Extract the contents of the downloaded file to a directory on your Windows VPS, such as C:\wamp\www\mediawiki.

Step 3: Create a Database for MediaWiki

Next, create a database for your MediaWiki installation:

  1. Open your MySQL or MariaDB command line client.
  2. Create a new database for MediaWiki:
    CREATE DATABASE mediawiki;
  3. Create a new user and assign privileges:
    CREATE USER 'mediawiki_user'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON mediawiki.* TO 'mediawiki_user'@'localhost';
  4. Flush the privileges:
    FLUSH PRIVILEGES;

Step 4: Configure Apache

Now, configure Apache to serve your MediaWiki installation:

  1. Open the Apache configuration file, usually located at C:\Apache24\conf\httpd.conf.
  2. Add the following configuration at the end of the file:
    Alias /mediawiki "C:/wamp/www/mediawiki"
    DocumentRoot "C:/wamp/www/mediawiki"
    <Directory "C:/wamp/www/mediawiki">
      Options FollowSymLinks
      AllowOverride All
      Require all granted
    </Directory>
  3. Restart Apache for the changes to take effect.

Step 5: Run the MediaWiki Installation Script

Now, it’s time to run the installation script:

  1. Open your web browser and navigate to http://localhost/mediawiki (or http:///mediawiki if accessing remotely).
  2. The MediaWiki installation page will appear. Follow the on-screen instructions to complete the installation:
    • Enter the database details you created earlier.
    • Set up your admin user credentials for the MediaWiki site.
    • Choose the language and configure any other necessary settings.
  3. Once the installation is complete, you will be provided with a configuration file LocalSettings.php.
  4. Download and save the LocalSettings.php file to the root directory of your MediaWiki installation, e.g., C:\wamp\www\mediawiki\LocalSettings.php.

Step 6: Secure Your MediaWiki Installation

To secure your MediaWiki site, consider these additional steps:

  • Set up a reverse proxy with SSL using Nginx or Apache to enable HTTPS.
  • Set proper file permissions for the MediaWiki installation directory to protect sensitive files.
  • Regularly update MediaWiki to keep your installation secure.

Step 7: Verify the Installation

After completing the installation, visit your MediaWiki site by navigating to http://localhost/mediawiki or your server’s IP address. You should be able to see the MediaWiki interface and log in with your admin credentials.

Conclusion

Congratulations! You have successfully installed MediaWiki on your Windows VPS. You can now start using MediaWiki to create and manage your own wiki site.

© 2024 Your Company. All rights reserved.