Saturday, 13 September 2025

How to Set up a MediaWiki Site

You've chosen a fun and educational project! Running a home server for a family wiki is a great way to learn about web hosting. Here's a step-by-step guide to help you get your MediaWiki site up and running.

1. Set Up Your Home Server

The first step is to turn a computer into a web server. You'll need to install a software stack that includes a web server, a database, and a scripting language. This combination is often called a LAMP stack (Linux, Apache, MySQL, PHP) or a WAMP stack (Windows, Apache, MySQL, PHP). Using a pre-packaged installer is the easiest way to get started.

  • Operating System: Linux is a popular choice for servers because it's free and highly customizable. However, you can also use a Windows or macOS machine.

  • Software Stack: Install a bundle like XAMPP (for Windows, macOS, or Linux) or WampServer (for Windows only). These packages install Apache, MySQL/MariaDB, and PHP all at once. Download the installer, run it, and follow the on-screen instructions.

Once the installation is complete, you should be able to access a test page by typing http://localhost into your web browser. If you see a welcome page, your web server is running correctly.


2. Install MediaWiki

Now that you have a server environment, you can install the MediaWiki software.

  1. Download MediaWiki: Go to the official MediaWiki website and download the latest stable version as a .zip or .tar.gz file.

  2. Extract and Place Files: Unzip the downloaded file. Find your web server's document root directory. For XAMPP, this is often the htdocs folder. Copy the extracted MediaWiki folder into the htdocs directory. You can rename the folder to something simple, like wiki.

  3. Create a Database: Open the database management tool that came with your software bundle, like phpMyAdmin (accessible via your web server's control panel). Create a new, empty database for your wiki. For example, you could name it my_wiki. You'll also need to create a database user with all privileges for this new database.

  4. Run the Installation Script: In your web browser, navigate to the MediaWiki installation script. If you placed the folder in the htdocs directory and named it wiki, the URL will be http://localhost/wiki. The script will guide you through the setup process. It will ask for your database details (database name, username, and password), the name of your wiki, and your administrator account information.

  5. Save the Configuration File: After the installation is finished, the script will generate a file named LocalSettings.php. You must download this file and place it in the root directory of your MediaWiki installation (i.e., inside the wiki folder).


3. Point Your Domain to the Server

This is the most complex part of the process, as your home internet connection likely has a dynamic IP address, which changes periodically. A domain name needs to point to a stable IP address. To solve this, you'll need a Dynamic DNS (DDNS) service.

  1. Sign Up for a DDNS Service: Choose a DDNS provider. Many domain registrars offer this as an add-on, or you can use a dedicated service.

  2. Configure Your Domain: Log in to your domain registrar's account. In the DNS settings, change the nameservers to point to your DDNS provider's nameservers. Then, in the DDNS service's control panel, add your domain and create a hostname (e.g., wiki.yourdomain.com).

  3. Install a DDNS Update Client: This is a small program that runs on your server computer. It monitors your public IP address. When the IP changes, the client automatically sends an update to your DDNS provider, which then updates your domain's DNS records.

  4. Configure Port Forwarding on Your Router: Your router acts as a gatekeeper for your home network. To allow external traffic to reach your server, you need to set up port forwarding. Log in to your router's admin panel and forward inbound traffic on port 80 (HTTP) and port 443 (HTTPS) to the static local IP address of your server computer.

    • Note: For security, only open these ports when you need the site to be accessible to others. When you're done, you can turn off the web server software or disable the port forwarding rules.

After completing these steps, your domain name should now point to your home server. When the server is running and the internet is on, your family can access the wiki by typing your domain name into their browser.

Host and Play Videos from Your Server

If you want to upload and host your own videos, you'll need a different extension and a video processing tool.

  • Install an extension: The TimedMediaHandler extension is the standard for this. It's used by Wikimedia projects (like Wikipedia) and provides a powerful way to handle video and audio files.

  • Install a video encoder: To play videos in a web browser, they often need to be in a specific format (like WebM or Ogg) and optimized for streaming. The TimedMediaHandler extension uses a tool called FFmpeg to do this on your server. You'll need to install FFmpeg and configure the extension to use it.

  • Upload the video: Once the extension and FFmpeg are set up, you can upload a video file just like you would an image. The wiki will automatically process the file and create a playable player on the page, similar to how an image thumbnail is generated.

Both methods give you the ability to add and play videos, giving your family a much more dynamic and engaging wiki!

No comments:

Post a Comment