Server rental store

How to Set Up a Test Environment on a Rented Server

---

# How to Set Up a Test Environment on a Rented Server

This article details the steps required to set up a test environment for MediaWiki on a rented server. This is crucial for safely testing extensions, themes, and configuration changes before implementing them on a live, production wiki. We will cover server requirements, software installation, MediaWiki installation, and basic configuration. This guide assumes you have basic familiarity with the command line and server administration.

1. Server Requirements and Selection

Choosing the right server is essential. The specifications will depend on the size and expected traffic of your test wiki, but here are some minimum recommendations.

Specification Minimum Requirement Recommended
CPU 1 vCPU 2 vCPU
RAM 1 GB 2 GB
Disk Space 20 GB 40 GB (SSD preferred)
Operating System Ubuntu 20.04 LTS Ubuntu 22.04 LTS

Popular providers include DigitalOcean, Linode, Vultr, and Amazon EC2. Consider the cost, data center location (closer to your users is better), and scalability options when making your decision. Ensure the server offers SSH access for remote administration. A clean operating system installation is highly recommended.

2. Software Installation

Once you have access to your server, you need to install the necessary software: a web server (Apache or Nginx), PHP, and a database server (MySQL/MariaDB or PostgreSQL). We will use Apache, PHP, and MariaDB as an example.

2.1 Apache Installation

```bash sudo apt update sudo apt install apache2 sudo systemctl start apache2 sudo systemctl enable apache2 ```

2.2 PHP Installation

Ensure you install the necessary PHP modules for MediaWiki.

```bash sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-mbstring php-xml php-zip php-intl php-bcmath ```

2.3 MariaDB Installation

```bash sudo apt install mariadb-server sudo systemctl start mariadb sudo systemctl enable mariadb sudo mysql_secure_installation ```

Follow the prompts from `mysql_secure_installation` to set a root password and improve security.

3. MediaWiki Installation

3.1 Downloading MediaWiki

Download the latest stable version of MediaWiki from the MediaWiki download page. Use `wget` on your server:

```bash wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz tar -xzf mediawiki-1.40.0.tar.gz sudo mv mediawiki-1.40.0 /var/www/html/mediawiki sudo chown -R www-data:www-data /var/www/html/mediawiki ```

3.2 Creating a Database

Log in to MariaDB as the root user:

```bash sudo mysql -u root -p ```

Create a database and user for MediaWiki:

```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 secure password.

3.3 Running the MediaWiki Installation Script

Navigate to your MediaWiki directory in a web browser: `http://your_server_ip/mediawiki/`. Follow the on-screen instructions. You will need to provide the database information (database name, username, password).

3.4 Configuration Settings

During the installation process, you will be prompted for configuration settings. Pay close attention to `$wgSitename` (the name of your wiki) and `$wgServer`. These settings can be modified later in `LocalSettings.php`. The installer will create a `LocalSettings.php` file, which is the core configuration file for MediaWiki.

4. Basic Configuration and Security

After installation, review the `LocalSettings.php` file. Important settings to consider:

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