Server rental store

Azure

# Azure Server Configuration for MediaWiki 1.40

This article provides a comprehensive guide to configuring a MediaWiki 1.40 installation on the Microsoft Azure platform. It is geared towards newcomers to both Azure and MediaWiki administration. We will cover selecting a virtual machine, configuring the operating system, installing the necessary software, and hardening the server for optimal performance and security. This guide assumes a basic understanding of networking concepts. Refer to Help:Contents for general MediaWiki help.

1. Choosing an Azure Virtual Machine

Selecting the appropriate Azure Virtual Machine (VM) size is crucial for performance. The ideal size depends on the anticipated traffic, the size of the wiki, and the complexity of extensions used. Consider starting with a smaller instance and scaling up as needed. We will focus on using Linux VMs as they are often more cost-effective for MediaWiki hosting. See Manual:Configuration settings for more information on performance tuning.

Here's a comparison of commonly used VM sizes for MediaWiki:

VM Size vCPUs Memory (GiB) Estimated Cost (USD/month - varies by region) Suitable For
B1ls 1 0.5 $10 - $20 Very small wikis, testing
B2ms 2 8 $40 - $60 Small wikis, low traffic
D2s v3 2 8 $60 - $90 Medium wikis, moderate traffic
D4s v3 4 16 $120 - $180 Large wikis, high traffic

Remember to check the official Azure pricing calculator for the most up-to-date and region-specific costs. Also, consider using Azure Monitor for performance tracking.

2. Operating System Configuration

We recommend using Ubuntu Server 22.04 LTS as the operating system. This provides a stable and well-supported platform. After provisioning the VM, perform the following steps:

1. **Update the System:** Run `sudo apt update && sudo apt upgrade -y` to ensure you have the latest security patches. 2. **Create a New User:** Avoid using the root account directly. Create a dedicated user for MediaWiki administration: `sudo adduser mediaperson`. Add this user to the `sudo` group: `sudo usermod -aG sudo mediaperson`. 3. **Configure Firewall:** Use `ufw` to configure the firewall. Allow SSH (port 22), HTTP (port 80), and HTTPS (port 443) traffic: * `sudo ufw allow 22` * `sudo ufw allow 80` * `sudo ufw allow 443` * `sudo ufw enable` 4. **Disable Password Authentication for SSH:** Enhance security by disabling password authentication and using SSH keys. See Manual:SSH access for details.

3. Software Installation

This section details the installation of the necessary software components.

1. **Web Server (Apache):** Install Apache using `sudo apt install apache2 -y`. 2. **PHP:** Install PHP and required modules: `sudo apt install php libapache2-mod-php php-cli php-mysql php-gd php-curl php-mbstring php-xml php-zip php-intl -y`. Verify the PHP version: `php -v`. 3. **MySQL/MariaDB:** Install MariaDB, a popular open-source database: `sudo apt install mariadb-server -y`. Secure the installation using `sudo mysql_secure_installation`. 4. **Composer:** Install Composer, a dependency manager for PHP: Follow the instructions on [https://getcomposer.org/](https://getcomposer.org/).

4. MediaWiki Installation

1. **Download MediaWiki:** Download the latest stable version of MediaWiki (1.40) from [https://www.mediawiki.org/wiki/Download](https://www.mediawiki.org/wiki/Download). 2. **Extract the Files:** Extract the downloaded archive to the web server's document root (usually `/var/www/html/`): `sudo tar -xzf MediaWiki-1.40.x.tar.gz -C /var/www/html/`. 3. **Configure the Database:** Create a database and user in MariaDB for MediaWiki. Grant appropriate privileges to the user. See Manual:Database setup for detailed instructions. 4. **Run the Installation Script:** Access the MediaWiki installation script through your web browser (e.g., `http://your_server_ip/mediawiki/`). Follow the on-screen instructions. 5. **Configure `LocalSettings.php`:** Edit the `LocalSettings.php` file (located in the `/var/www/html/mediawiki/`) to configure database credentials, site name, and other settings. See Configuration:Configuration settings for more details.

5. Server Hardening and Optimization

Here's a table summarizing some hardening and optimization steps:

Task Description Priority
Enable HTTPS Use Let's Encrypt or other SSL certificate to encrypt traffic. High
Configure PHP Memory Limit Adjust `memory_limit` in `php.ini` to an appropriate value (e.g., 256M or 512M). Medium
Enable OPcache Enable PHP OPcache to improve performance. Medium
Regularly Update System Keep the operating system and all software packages up to date. High
Configure Backups Implement regular database and file system backups. Use Maintenance:Backups for guidance. High

6. Monitoring and Maintenance

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