Server rental store

CentOS Stream

# CentOS Stream Server Configuration for MediaWiki 1.40

This article details the recommended server configuration for running MediaWiki 1.40 on a CentOS Stream based system. It's geared towards system administrators and those new to deploying MediaWiki. CentOS Stream is a rolling-release Linux distribution, so maintaining up-to-date packages is crucial for security and stability. This guide focuses on a basic, functional setup; advanced configurations like Load balancing and Caching are outside the scope of this document.

== System Requirements

The following table outlines the minimum and recommended system requirements for a MediaWiki installation. These numbers are *estimates* and will vary based on wiki size, traffic, and usage patterns.

Requirement Minimum Recommended
CPU 2 Cores 4+ Cores
RAM 4 GB 8+ GB
Disk Space 20 GB 50+ GB (SSD preferred)
Operating System CentOS Stream 8 or 9 CentOS Stream 9 (latest)
Web Server Apache 2.4 or Nginx 1.18 Apache 2.4 or Nginx 1.20+
Database MariaDB 10.3 or PostgreSQL 12 MariaDB 10.6+ or PostgreSQL 14+

It's important to note that these are starting points. A heavily used wiki with many images and frequent edits will require significantly more resources. Regularly monitor your server's performance using tools like top, htop, and vmstat.

== Software Installation

This section outlines the installation of the necessary software components.

1. **Update the System:** ```bash sudo dnf update -y ```

2. **Install the Web Server (Apache):** ```bash sudo dnf install httpd -y sudo systemctl start httpd sudo systemctl enable httpd ``` Or, if you prefer Nginx: ```bash sudo dnf install nginx -y sudo systemctl start nginx sudo systemctl enable nginx ``` Remember to configure your firewall to allow HTTP (port 80) and HTTPS (port 443) traffic. This is typically done with firewalld.

3. **Install the Database (MariaDB):** ```bash sudo dnf install mariadb-server mariadb -y sudo systemctl start mariadb sudo systemctl enable mariadb sudo mysql_secure_installation ``` Follow the prompts to set a root password and secure your MariaDB installation. Consider using a stronger password than the default.

4. **Install PHP and Required Extensions:** ```bash sudo dnf install php php-mysqlnd php-gd php-xml php-mbstring php-intl php-zip php-bcmath php-curl -y ``` Ensure the PHP version is compatible with MediaWiki 1.40 (PHP 7.4 or higher is recommended).

== PHP Configuration

Proper PHP configuration is critical for MediaWiki performance and security. Adjust the `php.ini` file (usually located in `/etc/php.ini`) with the following settings:

Setting Value Description
`memory_limit` 256M Maximum memory a script may consume. Increase if you encounter memory errors.
`upload_max_filesize` 100M Maximum allowed size for uploaded files. Adjust based on your wiki's needs.
`post_max_size` 100M Maximum size of POST data that PHP will accept. Must be greater than or equal to `upload_max_filesize`.
`max_execution_time` 300 Maximum time a script is allowed to run.

Restart the web server after making changes to `php.ini`. For Apache: `sudo systemctl restart httpd`. For Nginx: `sudo systemctl restart nginx`.

== MediaWiki Installation

1. **Download MediaWiki:** Download the latest stable release of MediaWiki 1.40 from the MediaWiki download page.

2. **Extract the Archive:** Extract the downloaded archive to your web server's document root (e.g., `/var/www/html` for Apache, or `/usr/share/nginx/html` for Nginx).

3. **Set File Permissions:** Ensure the web server user has appropriate permissions to read and write to the MediaWiki files and directories. For Apache, this is typically `apache`. For Nginx, it's often `nginx`. ```bash sudo chown -R apache:apache /var/www/html/mediawiki sudo chmod -R 755 /var/www/html/mediawiki ```

4. **Run the Installation Script:** Access the MediaWiki installation script through your web browser (e.g., `http://your_server_ip/mediawiki/index.php`). Follow the on-screen instructions to configure your wiki, including database connection details.

5. **Configure `LocalSettings.php`:** After the installation, edit the `LocalSettings.php` file to fine-tune your wiki's settings. Pay close attention to the `$wgSecretKey` setting for security.

== Security Considerations

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