Manual:Configuration
- Manual:Configuration
This article details the server configuration requirements and recommendations for running MediaWiki 1.40. It is intended for system administrators and those responsible for setting up and maintaining a MediaWiki installation. Proper server configuration is crucial for performance, security, and stability.
System Requirements
MediaWiki 1.40 has specific system requirements. Meeting these requirements ensures optimal operation. The following table outlines the minimum and recommended specifications.
Minimum Requirements | Recommended Requirements |
---|---|
Operating System: Linux, Windows Server, macOS Server | Operating System: Linux (CentOS 7+, Ubuntu 20.04+) |
PHP: 7.3.0 | PHP: 8.1+ |
Database: MySQL/MariaDB 5.5, PostgreSQL 9.4, SQLite 3.7.17 | Database: MariaDB 10.6+, PostgreSQL 14+ |
Web Server: Apache 2.4, Nginx 1.10 | Web Server: Apache 2.4+, Nginx 1.18+ |
Memory: 512MB RAM | Memory: 4GB+ RAM |
Disk Space: 1GB | Disk Space: 10GB+ (depending on content size) |
It is highly recommended to use a 64-bit operating system for improved performance and scalability. Regularly check the Manual:Upgrading documentation for the latest supported PHP and database versions.
Web Server Configuration
The web server (Apache or Nginx) plays a critical role in serving MediaWiki pages. Proper configuration is essential for performance and security.
Apache Configuration:
- Enable `mod_rewrite` for URL rewriting. This is crucial for the clean URLs used by MediaWiki.
- Configure virtual hosts appropriately, pointing the document root to the `public` directory of your MediaWiki installation.
- Consider using `mod_expires` to cache static assets (images, CSS, JavaScript) for improved performance.
- Secure your Apache configuration by disabling directory listing and configuring appropriate access controls. Refer to the Manual:Configuration page for more detailed instructions.
Nginx Configuration:
- Configure Nginx to pass PHP requests to a PHP-FPM process.
- Define server blocks for your MediaWiki installation, pointing the root directory to the `public` directory.
- Implement caching mechanisms for static assets using `expires` directives.
- Configure appropriate security headers to protect against common web vulnerabilities. More information can be found at Manual:Pywikibot/Configuration/Nginx.
Database Configuration
MediaWiki relies on a database to store all its content and configuration data. Choosing and configuring the database correctly is paramount.
Database System | Configuration Notes |
---|---|
MySQL/MariaDB | Ensure the character set is set to `utf8mb4` for full Unicode support. Configure appropriate connection limits and buffer sizes based on expected traffic. |
PostgreSQL | Enable the `pg_trgm` extension for improved search performance. Tune the `shared_buffers` and `work_mem` parameters for optimal performance. |
SQLite | Suitable for small, low-traffic installations. Not recommended for production environments due to concurrency limitations. |
The `LocalSettings.php` file contains the database connection details. The following snippet shows an example for MySQL/MariaDB:
```php $wgDBtype = 'mysqli'; $wgDBserver = 'localhost'; $wgDBname = 'my_mediawiki_database'; $wgDBuser = 'my_mediawiki_user'; $wgDBpassword = 'my_mediawiki_password'; ```
Replace the placeholders with your actual database credentials. Consult the Manual:Database documentation for detailed instructions on database setup and configuration.
PHP Configuration
PHP is the scripting language used by MediaWiki. Optimizing PHP configuration is crucial for performance.
PHP Setting | Recommended Value |
---|---|
`memory_limit` | 256M+ |
`upload_max_filesize` | 100M (adjust based on needs) |
`post_max_size` | 100M (adjust based on needs) |
`max_execution_time` | 300 |
`date.timezone` | Your timezone (e.g., `America/Los_Angeles`) |
These settings are configured in the `php.ini` file. Ensure that the necessary PHP extensions are enabled, including `mysqli`, `pdo_mysql`, `gd`, `mbstring`, and `intl`. Refer to the Manual:PHP documentation for a complete list of required and recommended PHP extensions. Using a PHP opcode cache like Manual:OpcodeCache can significantly improve performance.
Caching Configuration
Implementing caching mechanisms is essential for improving MediaWiki's performance, especially under high load.
- **Object Cache:** Use an object cache (e.g., Memcached, Redis) to cache frequently accessed data, such as database query results and parser cache. Configure `LocalSettings.php` with the appropriate caching settings. See Manual:Caching.
- **Parser Cache:** The parser cache stores the output of parsing wiki text, reducing the need to re-parse the same content repeatedly.
- **HTTP Caching:** Configure your web server to cache static assets (images, CSS, JavaScript) using appropriate cache headers.
Security Considerations
- Keep MediaWiki and all its dependencies up to date to patch security vulnerabilities.
- Enable HTTPS to encrypt communication between the server and clients.
- Implement strong password policies for all user accounts.
- Restrict access to the `LocalSettings.php` file.
- Regularly review and update your server's security configuration. See Manual:Security for more details.
- Consider using a Web Application Firewall (WAF) to protect against common web attacks.
Manual:Installation guide Manual:Configuration Manual:Upgrading Manual:Database Manual:PHP Manual:Caching Manual:Security Manual:Admin Manual:FAQ Manual:Extension installation Manual:Command-line tools Manual:API Manual:User rights Manual:Search Manual:Skins Manual:Customizing output
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.* ⚠️