Debian
- Debian Server Configuration for MediaWiki 1.40
This article details the configuration of a Debian server to optimally host MediaWiki 1.40. It is intended for system administrators and those new to server administration wishing to deploy a MediaWiki instance. We will cover the operating system selection, essential packages, web server configuration, database setup, PHP configuration, and security considerations.
1. Operating System Selection and Initial Setup
Debian is an excellent choice for a MediaWiki server due to its stability, security, and extensive package repository. We recommend Debian 11 (Bullseye) or Debian 12 (Bookworm) for a modern and well-supported system.
- **Download:** Download the latest Debian image from the official website: [1](https://www.debian.org/distrib/)
- **Installation:** Follow the Debian installation guide to install the operating system. During installation, ensure you select a system user for administration, and configure SSH access for remote management. A minimal installation is sufficient. Remember to set a strong root password during the installation process.
- **Updates:** After installation, immediately update the package list and upgrade the system:
```bash sudo apt update sudo apt upgrade ```
2. Essential Packages
Install the necessary packages for running MediaWiki: a web server (Apache or Nginx), PHP, a database server (MySQL/MariaDB or PostgreSQL), and related utilities.
Package | Description |
---|---|
`apache2` | The Apache web server. |
`nginx` | A high-performance web server (alternative to Apache). |
`php` | The PHP scripting language. |
`php-mysql` or `php-pgsql` | PHP extensions for MySQL/MariaDB or PostgreSQL database connectivity. |
`mysql-server` or `mariadb-server` | The MySQL or MariaDB database server. |
`postgresql` | The PostgreSQL database server. |
`unzip` | Utility for unzipping the MediaWiki archive. |
`git` | Version control system, useful for updating MediaWiki. |
To install these packages (example using Apache, MariaDB, and PHP):
```bash sudo apt install apache2 php libapache2-mod-php php-mysql mariadb-server unzip git ```
3. Web Server Configuration (Apache Example)
Configure Apache to serve the MediaWiki installation.
- **Virtual Host:** Create a new virtual host configuration file (e.g., `/etc/apache2/sites-available/mediawiki.conf`):
```apache <VirtualHost *:80> ServerName your.mediawiki.domain DocumentRoot /var/www/mediawiki
<Directory /var/www/mediawiki> Options FollowSymLinks AllowOverride All Require all granted </Directory>
ErrorLog ${APACHE_LOG_DIR}/mediawiki_error.log CustomLog ${APACHE_LOG_DIR}/mediawiki_access.log combined </VirtualHost> ```
- **Enable Site:** Enable the new site and disable the default site:
```bash sudo a2ensite mediawiki.conf sudo a2dissite 000-default.conf sudo systemctl restart apache2 ```
4. Database Setup (MariaDB Example)
Create a database and user for MediaWiki in MariaDB. Ensure you use a strong password!
- **Login:** Log in to the MariaDB shell:
```bash sudo mysql -u root -p ```
- **Create Database and User:**
```sql CREATE DATABASE mediawiki; CREATE USER 'mediawikiuser'@'localhost' IDENTIFIED BY 'your_strong_password'; GRANT ALL PRIVILEGES ON mediawiki.* TO 'mediawikiuser'@'localhost'; FLUSH PRIVILEGES; EXIT; ```
5. PHP Configuration
Configure PHP to meet MediaWiki's requirements. Edit the `php.ini` file (usually located in `/etc/php/[version]/apache2/php.ini`).
Setting | Value | Description |
---|---|---|
`memory_limit` | `256M` | Minimum memory limit for PHP scripts. |
`upload_max_filesize` | `100M` | Maximum allowed file size for uploads. |
`post_max_size` | `100M` | Maximum size of POST data. |
`max_execution_time` | `300` | Maximum execution time for PHP scripts (in seconds). |
`date.timezone` | `Your/Timezone` | Set the correct timezone for your server. (e.g. America/Los_Angeles) |
Restart Apache after making changes to `php.ini`:
```bash sudo systemctl restart apache2 ```
6. MediaWiki Installation
- **Download:** Download the latest MediaWiki release from [2](https://www.mediawiki.org/wiki/Download).
- **Extract:** Extract the downloaded archive to the document root of your web server (e.g., `/var/www/mediawiki`).
- **Permissions:** Ensure the web server user (usually `www-data`) has write access to the `images` and `extensions` directories within the MediaWiki installation.
```bash sudo chown -R www-data:www-data /var/www/mediawiki/images sudo chown -R www-data:www-data /var/www/mediawiki/extensions ```
- **Run the Installer:** Access your MediaWiki installation through your web browser (e.g., `http://your.mediawiki.domain`). Follow the on-screen instructions to complete the installation, providing the database credentials you created earlier. The installer will create the necessary database tables. Be sure to create a strong administrator password.
7. Security Considerations
- **Firewall:** Configure a firewall (e.g., `ufw`) to restrict access to your server to only necessary ports (e.g., 80 for HTTP, 443 for HTTPS, 22 for SSH). See Firewall Configuration.
- **HTTPS:** Enable HTTPS by obtaining an SSL/TLS certificate (e.g., using Let's Encrypt) and configuring your web server to use it. See HTTPS Setup.
- **Regular Updates:** Keep your operating system, web server, PHP, and MediaWiki installation up-to-date with the latest security patches. See System Updates.
- **Strong Passwords:** Use strong, unique passwords for all user accounts, including the database user and the MediaWiki administrator account.
- **File Permissions:** Regularly review and adjust file permissions to ensure they are as restrictive as possible.
- **Disable Directory Listing:** Ensure directory listing is disabled in your web server configuration.
- **Extension Security:** Carefully evaluate the security implications of any MediaWiki Extension Installation before installing them.
8. Performance Tuning
Component | Tuning Recommendations |
---|---|
Database | Optimize queries, use indexes, and consider caching. |
PHP | Utilize opcode caching (e.g., OPcache). |
Web Server | Enable keep-alive connections and compression. |
MediaWiki | Configure caching settings in `LocalSettings.php`. |
This article provides a foundation for setting up a Debian server for MediaWiki 1.40. Further customization and optimization may be required based on your specific needs and traffic levels. Consult the official MediaWiki documentation for more detailed information: [3](https://www.mediawiki.org/wiki/Manual:Configuration_form). Refer to Server Security for more information about securing your server. Also consider Database Backups to protect your wiki data.
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.* ⚠️