Setting up MediaWiki
This might seem somewhat amusing, having a how to set up MediaWiki inside a MediaWiki, at first thought.
However it's quite important as people (I) forget the process after 5 weeks of initial action, and software they always fail in one way or another.
So as a panic suppressor in case something goes wrong, I will keep track of how this MediaWiki instance was set up.
Preparations
The process can't really be done without the help of ChatGPT. Although its knowledge is cutoff at September 2021 (or as it insists), there seem to be sufficient MediaWiki-related knowledge in OpenAI's pandora box.
But you essentially cannot set up a MediaWiki only with ChatGPT. You need
- A (Linux) server. I prefer APT-based distros like Debian or Ubuntu, I might migrate to NixOS when I master the dark arts of Nix but not now. Linux because I don't really know how to work with any other server OSes.
- Web server, Apache 2 or Nginx. I use Nginx because it advertises itself to be 'a lightweight web server' and the name is cooler.
- PHP and all the necessary modules. Will discuss in detail in relative sections.
- php-intl for Unicode parsing. Probably useful for a multilingual Wiki like this.
- Certbot for setting up HTTPS certificate and automatically renewing it. Skip this if you like the terrifying 'Not secure' prompt.
- Preferably a domain name. I am not sure if you can get a HTTPS cert with only the IP address. My knowledge says you can't.
- MySQL or PostgreSQL or SQLite. These are the 3 options supported and required by MediaWiki to set up the database. I somehow managed to break MariaDB completely on this server so I had to resort to SQLite because it looked like the least troublesome. Using some MySQL compatible might be the most traditional choice but someone close said Postgre is ages ahead of MySQL so I really have no idea now.
- Several essential Linux utilities such as ssh, wget, tar/unzip/7z, etc, etc.
- imagemagick (convert) for MediaWiki to generate thumbnails on the fly.
- I'll add to this if I notice anything I forgot.
Environment setup
The whole thing starts with setting up the Linux server but we'll skip it here. Nowadays you just go into any VPS provider and pick their cheapest plan and you usually get a working Linux server with public IP address. That's very neat if you ask me.