MediaWiki is a powerful open-source wiki platform that allows you to create and manage your own wiki. In this guide, we will walk you through the steps to install MediaWiki with Nginx and secure it with a free Let's Encrypt SSL certificate on Ubuntu 20.04. This setup is perfect for your windows vps uk environment.

Prerequisites

Before you begin, ensure that you have the following:

  • An active Ubuntu 20.04 server.
  • Root access to the server or a user with sudo privileges.
  • A domain name pointed to your server (optional).

Step 1: Update Your System

First, update your system packages:

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Packages

Install Nginx, PHP, and necessary PHP extensions:

sudo apt install nginx php-fpm php-mysql php-xml php-mbstring php-intl php-zip -y

Step 3: Start and Enable Nginx

Start the Nginx service and enable it to run on boot:

sudo systemctl start nginx
sudo systemctl enable nginx

Step 4: Download and Install MediaWiki

Change to the web directory:

cd /var/www/html

Download MediaWiki:

wget https://releases.wikimedia.org/mediawiki/1.37/mediawiki-1.37.1.tar.gz

Extract the downloaded file:

tar -xvzf mediawiki-1.37.1.tar.gz
mv mediawiki-1.37.1 mediawiki

Step 5: Set Permissions

Set the proper permissions for the MediaWiki directory:

sudo chown -R www-data:www-data /var/www/html/mediawiki
sudo chmod -R 755 /var/www/html/mediawiki

Step 6: Configure Nginx for MediaWiki

Create a new Nginx configuration file:

sudo nano /etc/nginx/sites-available/mediawiki

Add the following configuration:

server {
        listen 80;
        server_name your_domain.com;

        root /var/www/html/mediawiki;
        index index.php index.html index.htm;

        location / {
            try_files $uri $uri/ /index.php?$args;
        }

        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
    }

Replace your_domain.com with your actual domain name.

Step 7: Enable the Configuration

Enable the new configuration and test it:

sudo ln -s /etc/nginx/sites-available/mediawiki /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Step 8: Install Certbot for Let's Encrypt SSL

Install Certbot:

sudo apt install certbot python3-certbot-nginx -y

Obtain an SSL certificate:

sudo certbot --nginx -d your_domain.com

Step 9: Finish MediaWiki Installation

Open your web browser and go to:

https://your_domain.com

You will see the MediaWiki installation page. Follow the instructions to complete the installation.

Conclusion

You have successfully installed MediaWiki on Ubuntu 20.04 with Nginx and Let's Encrypt SSL. This setup is perfect for your applications hosted on windows vps uk. For reliable and affordable virtual private server hosting windows, consider checking out Windows VPS UK.

Cette réponse était-elle pertinente? 0 Utilisateurs l'ont trouvée utile (0 Votes)