Server rental store

AlmaLinux

AlmaLinux Server Configuration for MediaWiki

This article details configuring an AlmaLinux server for hosting a MediaWiki 1.40 installation. It’s geared towards newcomers to server administration and assumes a basic understanding of the command line. We will cover the initial server setup, required software installation, and basic security considerations.

1. Initial Server Setup

Before installing MediaWiki, a base AlmaLinux server installation is required. This guide assumes a minimal installation via the command line. Ensure your server has a static IP address configured. You can configure this via `nmtui` or manually edit network configuration files. It’s crucial to have root access or a user with `sudo` privileges.

First, update the system:

```bash sudo dnf update -y ```

Next, set the hostname:

```bash sudo hostnamectl set-hostname mediawiki.example.com ```

(Replace `mediawiki.example.com` with your desired hostname.)

2. Installing Required Software

MediaWiki relies on several components. We’ll install these using the `dnf` package manager. This includes a web server (Apache), a database server (MariaDB), PHP, and necessary PHP extensions.

2.1. Apache Web Server

Apache will serve the MediaWiki files to users.

```bash sudo dnf install httpd -y sudo systemctl start httpd sudo systemctl enable httpd ```

Configure the firewall to allow HTTP (port 80) and HTTPS (port 443) traffic:

```bash sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reload ```

2.2. MariaDB Database Server

MariaDB will store the MediaWiki data.

```bash sudo dnf install mariadb-server mariadb -y sudo systemctl start mariadb sudo systemctl enable mariadb ```

Secure the MariaDB installation:

```bash sudo mysql_secure_installation ```

Follow the prompts to set a root password, remove anonymous users, disallow remote root login, and remove the test database.

2.3. PHP and Extensions

PHP is the scripting language MediaWiki is built upon. We need to install PHP and several required extensions.

```bash sudo dnf install php php-mysqlnd php-gd php-mbstring php-xml php-zip php-intl php-bcmath php-curl -y ```

Restart Apache after installing PHP:

```bash sudo systemctl restart httpd ```

3. PHP Configuration

Adjust the PHP configuration to optimize MediaWiki performance. Edit `/etc/php.ini` and adjust the following settings:

⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️