Contabo

From Server rental store
Jump to navigation Jump to search
  1. Contabo Server Configuration for MediaWiki 1.40

This article details configuring a Contabo Virtual Private Server (VPS) for running MediaWiki 1.40. It is aimed at newcomers to both Contabo and MediaWiki server administration. It assumes a basic understanding of the command line.

Introduction to Contabo

Contabo is a provider of VPS and dedicated servers known for offering relatively inexpensive options, particularly for resource-intensive applications like MediaWiki. They offer a variety of server configurations, and selecting the right one is crucial for optimal performance. Before starting, ensure you have a Contabo account and a VPS provisioned. This guide will focus on a typical VPS setup, but the principles apply to dedicated servers as well. You will need SSH access to your server. SSH is a secure shell protocol used to remotely access and manage your server.

Initial Server Setup

After provisioning your VPS, the first step is to secure it and update the system packages. This involves changing the default root password, updating the package lists, and upgrading installed packages.

1. **Change Root Password:** Use the `passwd` command to change the root password. 2. **Update Package Lists:** Run `sudo apt update` to update the list of available packages. 3. **Upgrade Packages:** Run `sudo apt upgrade` to upgrade all installed packages to their latest versions. 4. **Install essential packages:** `sudo apt install apache2 mariadb-server php php-cli php-mysql php-gd php-intl php-mbstring php-xml php-zip`

These packages are essential for running MediaWiki. Apache2 is the web server, MariaDB is the database server, and PHP is the scripting language MediaWiki is written in. The additional PHP modules provide necessary functionality.

Server Specifications (Example Configuration)

The following table outlines an example Contabo VPS configuration suitable for a medium-sized MediaWiki installation. Your specific needs may vary based on anticipated traffic and content volume.

Core Detail
CPU 4 vCores
RAM 8 GB
Storage 80 GB SSD
Bandwidth 100 GB/month (check your plan details)
Operating System Ubuntu 22.04 LTS (recommended)

It’s highly recommended to choose an SSD for storage, as it significantly improves database performance. Consider increasing RAM and storage if you anticipate heavy usage.

Database Configuration (MariaDB)

MariaDB needs to be secured and a database created for MediaWiki.

1. **Secure MariaDB:** Run `sudo mysql_secure_installation` and follow the prompts. This will set a root password, remove anonymous users, disallow remote root login, and remove the test database. 2. **Create Database:** Log into MariaDB using `sudo mysql -u root -p`. Then, execute the following SQL commands:

```sql CREATE DATABASE mediawiki; CREATE USER 'mediawiki'@'localhost' IDENTIFIED BY 'your_strong_password'; GRANT ALL PRIVILEGES ON mediawiki.* TO 'mediawiki'@'localhost'; FLUSH PRIVILEGES; EXIT; ```

Replace `'your_strong_password'` with a strong, unique password. Database security is crucial for protecting your MediaWiki installation.

Web Server Configuration (Apache2)

Apache2 must be configured to serve the MediaWiki files.

1. **Enable `mod_rewrite`:** Run `sudo a2enmod rewrite`. This module is essential for MediaWiki’s URL structure. 2. **Create Apache Configuration File:** Create a new configuration file for MediaWiki in `/etc/apache2/sites-available/mediawiki.conf` (or a similar name). The content should be similar to this:

```apache <VirtualHost *:80>

   ServerName yourdomain.com
   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> ```

Replace `yourdomain.com` with your actual domain name. Also, `/var/www/mediawiki` is the directory where you will upload the MediaWiki files.

3. **Enable the Configuration:** Run `sudo a2ensite mediawiki.conf`. 4. **Restart Apache:** Run `sudo systemctl restart apache2`.

Apache configuration is a critical step in ensuring your MediaWiki site is accessible and secure.

PHP Configuration

PHP needs to be configured to meet MediaWiki's requirements.

Setting Value
`memory_limit` 256M (or higher)
`upload_max_filesize` 100M (adjust as needed)
`post_max_size` 100M (adjust as needed)
`max_execution_time` 300

These settings can be adjusted in the `php.ini` file (usually located at `/etc/php/8.1/apache2/php.ini` - adjust the version number as needed). After making changes, restart Apache. PHP settings significantly impact MediaWiki's performance and functionality.

MediaWiki Installation

1. **Download MediaWiki:** Download the latest stable version of MediaWiki from [[1]]. 2. **Upload Files:** Upload the downloaded MediaWiki files to `/var/www/mediawiki`. 3. **Run the Installation Script:** Access your domain name in a web browser. This will launch the MediaWiki installation script. Follow the on-screen instructions, providing the database credentials you created earlier.

Security Considerations

  • **Firewall:** Configure a firewall (e.g., `ufw`) to only allow necessary ports (80 for HTTP, 443 for HTTPS, and 22 for SSH). Firewall configuration is an essential security practice.
  • **HTTPS:** Configure HTTPS using Let's Encrypt or another SSL certificate provider. HTTPS encryption protects data transmitted between your server and users.
  • **Regular Updates:** Keep your operating system, web server, database server, and PHP modules up-to-date with the latest security patches.
  • **Strong Passwords:** Use strong, unique passwords for all accounts.


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?

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