CentOS Stream 9
- CentOS Stream 9 Server Configuration for MediaWiki 1.40
This article details a recommended server configuration using CentOS Stream 9 for running MediaWiki 1.40. It is aimed at system administrators new to deploying MediaWiki and provides a comprehensive overview of the necessary software and configuration steps. This guide assumes a basic understanding of Linux server administration.
Introduction
CentOS Stream 9 is a rolling-release Linux distribution derived from Red Hat Enterprise Linux (RHEL). It provides a stable and up-to-date platform for hosting applications like MediaWiki. This configuration focuses on a production environment, prioritizing security, performance, and reliability. Before beginning, ensure you have a clean CentOS Stream 9 installation. Consider using a virtual machine (VM) like VirtualBox or VMware for testing.
System Requirements
The following table outlines the minimum and recommended system requirements for running MediaWiki 1.40 on CentOS Stream 9.
Requirement | Minimum | Recommended |
---|---|---|
CPU | 1 Core | 4+ Cores |
RAM | 2 GB | 8+ GB |
Storage | 20 GB | 100+ GB (SSD preferred) |
Operating System | CentOS Stream 9 | CentOS Stream 9 (latest updates) |
These are estimates; actual requirements will depend on the size of your wiki, the number of users, and the complexity of the content.
Software Installation
The following software packages are required:
- Apache (Web Server)
- PHP (Programming Language)
- MariaDB (Database Server)
- PHP-PECL-memcached (Optional: For caching)
- git (For MediaWiki installation)
The following commands install these packages using the `dnf` package manager:
```bash sudo dnf update -y sudo dnf install httpd php php-mysqlnd php-gd php-xml php-mbstring php-curl php-intl php-zip php-bcmath php-json php-common php-pecl-memcached mariadb-server git -y ```
Database Configuration
1. Start the MariaDB service:
```bash sudo systemctl start mariadb sudo systemctl enable mariadb ```
2. Secure the MariaDB installation:
```bash sudo mysql_secure_installation ```
Follow the prompts to set a root password and configure security settings.
3. Create a database and user for MediaWiki:
Connect to the MariaDB server as the root user:
```bash sudo mysql -u root -p ```
Then, execute the following SQL commands (replace `mediawiki_db` and `mediawiki_user` with your desired names):
```sql CREATE DATABASE mediawiki_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'mediawiki_user'@'localhost' IDENTIFIED BY 'your_strong_password'; GRANT ALL PRIVILEGES ON mediawiki_db.* TO 'mediawiki_user'@'localhost'; FLUSH PRIVILEGES; EXIT; ```
PHP Configuration
1. Edit the PHP configuration file (`/etc/php.ini`). Adjust the following settings:
* `memory_limit = 256M` (or higher, depending on your wiki's needs) * `upload_max_filesize = 50M` (adjust as needed) * `post_max_size = 50M` (adjust as needed) * `max_execution_time = 300` (adjust as needed) * `date.timezone = Your/Timezone` (e.g., `date.timezone = America/Los_Angeles`)
2. Restart Apache:
```bash sudo systemctl restart httpd ```
MediaWiki Installation
1. Download the latest MediaWiki 1.40 release from the MediaWiki download page.
2. Extract the archive to the web server's document root (usually `/var/www/html`):
```bash sudo tar -xzf mediawiki-1.40.0-tar.gz -C /var/www/html sudo chown -R apache:apache /var/www/html/mediawiki-1.40.0 ```
(Replace `mediawiki-1.40.0` with the actual directory name.)
3. Configure Apache virtual host:
Create a new virtual host configuration file (e.g., `/etc/httpd/conf.d/mediawiki.conf`):
```apache <VirtualHost *:80> ServerName your.wiki.domain DocumentRoot /var/www/html/mediawiki-1.40.0
<Directory /var/www/html/mediawiki-1.40.0> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory>
ErrorLog /var/log/httpd/mediawiki_error.log CustomLog /var/log/httpd/mediawiki_access.log combined </VirtualHost> ```
Replace `your.wiki.domain` with your actual domain name.
4. Restart Apache:
```bash sudo systemctl restart httpd ```
MediaWiki Configuration
1. Access the MediaWiki installation script through your web browser (e.g., `http://your.wiki.domain/mediawiki-1.40.0/index.php`).
2. Follow the on-screen instructions to configure MediaWiki. Provide the database details you created earlier (database type, database name, username, password).
3. Configure the `$wgSitename` variable in `LocalSettings.php` to your wiki's name.
4. Complete the installation process.
Security Considerations
- Keep your system and software up to date with security patches.
- Use a strong password for the MariaDB root user and MediaWiki database user.
- Configure a firewall (e.g., firewalld) to restrict access to necessary ports (80 and 443).
- Consider using HTTPS (SSL/TLS) to encrypt communication between the server and clients. Let's Encrypt provides free SSL certificates.
- Regularly back up your wiki's database and files.
Performance Tuning
The following table summarizes common performance tuning options.
Tuning Option | Description |
---|---|
Memcached | Enable Memcached caching to reduce database load. |
Database Indexing | Ensure proper database indexing for frequently queried tables. |
Opcode Caching (OPcache) | Enable PHP OPcache to cache compiled PHP code. |
HTTP Compression (gzip) | Enable gzip compression in Apache to reduce transfer sizes. |
Troubleshooting
- Check the Apache error logs (`/var/log/httpd/mediawiki_error.log`) for errors.
- Check the MariaDB error logs for database-related errors.
- Ensure that the PHP extensions required by MediaWiki are installed and enabled.
- Verify file permissions. The web server user (usually `apache`) needs read and write access to the MediaWiki directory.
Further Resources
Intel-Based Server Configurations
Configuration | Specifications | Benchmark |
---|---|---|
Core i7-6700K/7700 Server | 64 GB DDR4, NVMe SSD 2 x 512 GB | CPU Benchmark: 8046 |
Core i7-8700 Server | 64 GB DDR4, NVMe SSD 2x1 TB | CPU Benchmark: 13124 |
Core i9-9900K Server | 128 GB DDR4, NVMe SSD 2 x 1 TB | CPU Benchmark: 49969 |
Core i9-13900 Server (64GB) | 64 GB RAM, 2x2 TB NVMe SSD | |
Core i9-13900 Server (128GB) | 128 GB RAM, 2x2 TB NVMe SSD | |
Core i5-13500 Server (64GB) | 64 GB RAM, 2x500 GB NVMe SSD | |
Core i5-13500 Server (128GB) | 128 GB RAM, 2x500 GB NVMe SSD | |
Core i5-13500 Workstation | 64 GB DDR5 RAM, 2 NVMe SSD, NVIDIA RTX 4000 |
AMD-Based Server Configurations
Configuration | Specifications | Benchmark |
---|---|---|
Ryzen 5 3600 Server | 64 GB RAM, 2x480 GB NVMe | CPU Benchmark: 17849 |
Ryzen 7 7700 Server | 64 GB DDR5 RAM, 2x1 TB NVMe | CPU Benchmark: 35224 |
Ryzen 9 5950X Server | 128 GB RAM, 2x4 TB NVMe | CPU Benchmark: 46045 |
Ryzen 9 7950X Server | 128 GB DDR5 ECC, 2x2 TB NVMe | CPU Benchmark: 63561 |
EPYC 7502P Server (128GB/1TB) | 128 GB RAM, 1 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (128GB/2TB) | 128 GB RAM, 2 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (128GB/4TB) | 128 GB RAM, 2x2 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (256GB/1TB) | 256 GB RAM, 1 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (256GB/4TB) | 256 GB RAM, 2x2 TB NVMe | CPU Benchmark: 48021 |
EPYC 9454P Server | 256 GB RAM, 2x2 TB NVMe |
Order Your Dedicated Server
Configure and order your ideal server configuration
Need Assistance?
- Telegram: @powervps Servers at a discounted price
⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️