In this tutorial, we will walk through the process of installing Mediawiki on Elementary OS, a user-friendly Linux operating system. Mediawiki is a powerful and popular software platform that enables users to create and manage collaborative wikis, and it can be installed and configured easily on any Linux distribution, including Elementary OS.
Before we begin, you will need the following:
The first step to install Mediawiki is to download and extract it onto your machine. Here are the steps to follow:
Visit the official Mediawiki website at https://www.mediawiki.org/wiki/MediaWiki
and download the latest stable version of Mediawiki.
Once the download is complete, extract the contents of the compressed file to a suitable location on your machine. You can use your preferred archive tool to extract the file, or you can use the command line utility tar
to extract the file as follows:
$ tar -xvzf mediawiki-1.35.0.tar.gz
Note that you should replace mediawiki-1.35.0.tar.gz
with the actual name of the downloaded file.
Mediawiki requires a database to store its content and configuration information. Here are the steps to create a new database for Mediawiki:
Launch your database management system and log in with administrative privileges.
Create a new database for Mediawiki by running the following command:
CREATE DATABASE mediawiki_db;
Note that you can replace mediawiki_db
with any name that you prefer.
CREATE USER 'wikiuser'@'localhost';
GRANT ALL ON mediawiki_db.* TO 'wikiuser'@'localhost';
Note that you should replace wikiuser
with any username that you prefer.
Mediawiki requires a web server to serve its pages to end-users. You can use Apache or Nginx as your web server. Here are the steps to configure Apache or Nginx for Mediawiki:
$ sudo apt-get install apache2
/etc/apache2/sites-available/
directory by running the following command:$ sudo nano /etc/apache2/sites-available/mediawiki.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/mediawiki
ServerName wiki.example.com
ServerAlias www.wiki.example.com
<Directory /var/www/html/mediawiki/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Note that you should replace admin@example.com
, wiki.example.com
, and www.wiki.example.com
with your actual email and domain names.
$ sudo a2ensite mediawiki
$ sudo systemctl restart apache2
$ sudo apt-get install nginx
/etc/nginx/sites-available/
directory by running the following command:$ sudo nano /etc/nginx/sites-available/mediawiki.conf
server {
listen 80;
server_name wiki.example.com www.wiki.example.com;
root /var/www/html/mediawiki;
index index.php index.html index.htm;
access_log /var/log/nginx/wiki.example.com.access.log;
error_log /var/log/nginx/wiki.example.com.error.log;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location /images {
try_files $uri /mediawiki/index.php;
}
}
Note that you should replace wiki.example.com
and www.wiki.example.com
with your actual domain names.
mediawiki.conf
file in the /etc/nginx/sites-enabled/
directory by running the following command:$ sudo ln -s /etc/nginx/sites-available/mediawiki.conf /etc/nginx/sites-enabled/
$ sudo systemctl restart nginx
Now that your machine is configured, you can install Mediawiki by following these steps:
Open your web browser and navigate to your wiki domain name, for example, http://wiki.example.com
.
You will see the Mediawiki installation page. Follow the installation steps, including setting up the database connection, creating a new administrator account, and configuring the basic settings.
Once the installation is complete, you can log in to your new Mediawiki site and start using it.
In this tutorial, we have seen the steps required to install Mediawiki on Elementary OS. By following these steps, you can set up your own self-hosted wiki platform and use it to manage your collaborative content.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!