Table of Contents
MediaWiki VPS Install
I have recenlty rebuilt the VPS install during a hardware upgrade, and the Mediawiki
install is no longer in place.
The following guide would allow it to be re-installed should I decide to.
To compare mediawiki
with dokuwiki
I installed mediawiki
on my little shack server.
I followed the instructions here
https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Debian_or_Ubuntu
and did a few tweaks etc. to get things running.
I forgot to document the tweaks!
So I thought there would be no harm in installing it on my VPS to run alongside the main dokuwiki
site, with a view to deciding whether to switch to mediawiki
later.
Here are my steps to install mediawiki on the VPS machine, which already has a fully configured and working webserver & PHP. The main addition will be setting up a SQL server (probably MariaDB).
Installing pre-requisites
sudo apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring
wget https://releases.wikimedia.org/mediawiki/1.38/mediawiki-1.38.1.tar.gz
tar zxvf mediawiki-1.38.1.tar.gz
sudo mkdir /var/www/html/mediawiki
sudo mv mediawiki-1.38.1/* /var/www/html/mediawiki
That has installed a SQL server and the mediawiki
files into the webserver root. Next is to configure the SQL database to hold the wiki.
SQL Configuration
gm4slv@gm4slv:~$ sudo service mysql START gm4slv@gm4slv:~$ sudo mysql -u root -p Enter password: Welcome TO the MariaDB monitor. Commands END WITH ; OR \g. Your MariaDB connection id IS 36 Server version: 10.3.34-MariaDB-0+deb10u1 Debian 10 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab AND others. TYPE 'help;' OR '\h' FOR help. TYPE '\c' TO clear the CURRENT INPUT statement. MariaDB [(NONE)]> CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'mwPass'; Query OK, 0 ROWS affected (0.018 sec) MariaDB [(NONE)]> quit; Bye
Create the database and grant the user access
gm4slv@gm4slv:~$ sudo mysql -u root -p Enter password: Welcome TO the MariaDB monitor. Commands END WITH ; OR \g. Your MariaDB connection id IS 37 Server version: 10.3.34-MariaDB-0+deb10u1 Debian 10 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab AND others. TYPE 'help;' OR '\h' FOR help. TYPE '\c' TO clear the CURRENT INPUT statement. MariaDB [(NONE)]> CREATE DATABASE my_wiki; Query OK, 1 ROW affected (0.003 sec) MariaDB [(NONE)]> USE my_wiki; DATABASE changed MariaDB [my_wiki]> GRANT ALL ON my_wiki.* TO 'new_mysql_user'@'localhost'; Query OK, 0 ROWS affected (0.001 sec) MariaDB [my_wiki]> quit; Bye
Browse to https://gm4slv.org.uk/mediawiki and got an error message that there was a PHP component missing intl
sudo apt-get install php-intl
sudo service apache2 restart
Browse to mediawiki
again and all seems well. The message now is that LocalSettings.php is missing, which is created at the next step, following the on screen link.
Configure the SQL access:
Database Username : new_mysql_user Database Password : mwPass
Complete the questions, select the required extensions etc. and download the LocalSettings.php
file. Then upload the file to the VPS and put it in /var/www/html/mediawiki
Tweaks
File uploads
Make sure images
directory has ugo+rwx
permissions
Logo
Somehow upload a logo.png
into images
and edit LocalSetting.php
to point at the log:
$wgLogos = [ '1x' => "$wgResourceBasePath/images/logo.png", 'icon' => "$wgResourceBasePath/images/logo.png", ];
Image thumbnails & pdf
to be continued
sudo apt install ghostscript imagemagick xpdf-utils
add to LocalSettings.php:
$wgPdfProcessor = '/usr/bin/gs'; $wgPdfPostProcessor = $wgImageMagickConvertCommand; // if defined via ImageMagick // $wgPdfPostProcessor = '/usr/bin/convert'; // if not defined via ImageMagick $wgPdfInfo = '/usr/bin/pdfinfo'; $wgPdftoText = '/usr/bin/pdftotext'; $wgFileExtensions[] = 'pdf';
Now upload a pdf
file and it should appear in the file brower.
Try putting it in a page with the <gallery> funtion
<gallery> File:Blog.pdf|page=1 </gallery>
Page Info
— John Pumford-Green 29/06/22 15:15
Page last updated: 06/03/25 06:49 GMT