<-[[.:start]] ====== MediaWiki VPS Install ====== --- //John Pumford-Green 27/04/23 06:21// 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. {{:public:computers:screenshot_2022-06-29_15.43.11.png?direct&400|}} 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 funtion File:Blog.pdf|page=1 ==== Page Info ==== --- //John Pumford-Green 29/06/22 15:15// Page last updated: ~~LASTMOD~~ {{tag>mediawiki}}