Migrating a Mediawiki to a new Linux server

To get you started: Get a Linux VPS.

I chose Tavu.io, an ecohosting company with the data center deep inside the Finnish granite bedrock, a “renewable electricity only”-policy and a cloud infrastructure built on top of OpenStack.

For OS I chose latest Debian Stable which was version 9 at the time of writing.

Mediawiki's logo
Mediawiki is a wiki system of awesome quality and reliability

Tavu.io created the VPS on their OpenStack based cloud in a matter of few tens of seconds.

Then the system gave a temporary password and on login via ssh the system required a new password was set.

Login with the new password and run

sudo apt update && sudo apt upgrade

This will get the pre-installed software to their latest version numbers and may take a while.

Then I added a user name I usually use on Linux systems by entering:

sudo useradd -m -s /bin/bash <username>

Now set a password for username with

sudo passwd <username>

and add the user to /etc/sudoers (make a copy of the line that says “root” and change ‘root’ to your user name of choice) and log out and log in as the newly created user.

Now is a good time to get an firewall going so do so.

Now grab a list of installed packages with

dpkg --get-selections > packages-YYYY-MM-DD.list

This could be useful for later use.

Now install some software

sudo apt install tmux nmap apache2 lynx
  1. tmux is a shell session multiplexer
  2. nmap is a port scanner
  3. apache2 is a web server
  4. lynx is a terminal-based web browser

And some more software

sudo apt install htop atop itop iotop glances chkrootkit
  1. htop, atop, itop and glances are system monitoring (for humans)
  2. iotop is a IO (Input/Output) monitoring system for humans (requires sudo)
  3. chkrootkit is a software for checking if your system has a known rootkit installed (bad for you)

Migrating the Mediawiki

First install the dependencies as described below and only then we switch to following the moving a wiki guide. which consists of actually three operations:

  1. Making a backup of the Mediawiki on the old server
  2. Moving the backup to the new machine
  3. Restoring Mediawiki from the backup.

Installing Mediawiki’s dependencies

Now we move on to installing the dependencies of Mediawiki. For this we will follow the Mediawiki installation guide for Debian and Ubuntu (generic guide here) up-to-the-point of actually installing one.

sudo apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring

We installed MariaDB instead of MySQL. They are binary compatible so you can choose one or the other and also interchange them afterwards. Add the database and database user of your wiki and grant all rights on the database to the database user.

Those are the mandatory components and next up are the beneficial components out of which we chose the following

sudo apt-get install php-apcu php-intl imagemagick php-cli

Move required files and the database to new machine

If possible make sure that your Mediawiki is the latest version on the old server.

Next I packed and moved

  1. The database
  2. The Mediawiki directory /var/www/mediawiki
  3. The Mediawiki logs from /var/log/sites/mediawiki
  4. site configuration from /etc/apache/sites-available

and expanded them into the right place on the new server.

A sane approach to the Mediawiki files ownership is as follows

First recursively make you the owner of all of the Mediawiki directory and its subdirectories and files with

sudo chown -R <username> /var/www/mediawiki

and then explicitly making the images/-directory, where Mediawiki stores its writables, to be posession of user www-data (www-data is the user that Apache and Mediawiki run as) by

sudo chown -R www-data /var/www/mediawiki/images

Minimize downtime

The TTL (Time To Live) of the domain at the DNS also naturally affects the length of the outage so modifying it to very short time such as 15 minutes way in advance of commencing the migration.

I temporarily modified the domain name of the Mediawiki (in /etc/apache2/sites-available and also LocalSettings.php) to a temporary subdomain to test that the Mediawiki is working on the new server before doing the DNS change of the production Mediawiki. After you have viewed that the wiki is working on the new server change the domains back to the “real” one.

Following these two practices are simple practical things to do that help to make the imminent outage of your service as short as possible.


Configure Apache2

Link the .conf files with symbolic links from /etc/apache2/sites-available to /etc/apache2/sites-enabled.

ln -s ../sites-available/example.com example.com

Enable mod_rewrite which is needed for the pretty URLs to work.

sudo a2enmod rewrite

Test your Apache2 configuration with

sudo apachectl configtest

and fix your config untill the configuration says ‘Syntax OK’

The last step is that we need to make the Apache2 reload its configuration which is accomplished with

sudo service apache2 reload

Now navigate to the temporary subdomain’s /wiki/-directory and you should see your wiki there.

Warning: The Mediawiki extensions may have dependencies that are not satisfied so also check that each extension works.


If using reCAPTCHA

Google’s reCAPTCHA stopped working (CAPTCHA shows up but when it is time to approve the human as a human I got an error message that reCAPTCHA “cannot contact server”.

This seemed to be solved by logging in to the CAPTCHA management page at Google and deleting the old keys and generating new keys and naturally changing the keys to the new ones at Mediawiki’s LocalSettings.php


Important: Enable outgoing email for Mediawiki

Now we need to put in place a way for the Mediawiki to send emails (very important).

My registrar Gandi.net provides a mailing system which enables the one to use $wgSMTP (set this in LocalSettings) to send outgoing mailing. They also have 5 mailboxes and 1000 forwards included for each domain for all registrants so I can confidently use …@consumerium.org addresses since Gandi.net is rock-solid operation with a very wide palette of TLD’s though maybe 20% higher prices than the price leader which is often buggy, slow and unreliable if they just compete with the “cheapest on planet”.

Other method to get email to go outwards is to install a MTA (Mail Transfer Agent) such as Sendmail, Postfix or Nullmailer and configure it to send the messages.

Whichever method you chose to enable email do check that it works!

Happy wikiditing! – Juho

Installing a Kubuntu 17.04 (again)

This is a blog post mainly about how to flexibly reinstall Kubuntu 17.04 GNU/Linux OS after the previous install running into troubled waters and break down.

Cycle through more than one disk in the install clean approach so get an USB-to-SATA3 casing and some hard drives. The idea is that to install the next OS you do not need to overwrite the previous OS.

  • Get FireFox sync. This way you don’t need to import your bookmarks as sync does it for you.
  • Take previous disk out of the computer and insert another disk, connect the USB installation medium (and select boot order in BIOS or UEFI) and power up.
  • Install Kubuntu.
  • Boot Kubuntu
  • Open a shell and run ‘sudo apt update && sudo apt upgrade’ to get the installed software to the latest version.
  • Install software
    • Monitoring: ‘sudo apt install htop atop iotop glances’ (glances will install python)
    • Database: ‘sudo apt install mariadb-server’
    • Graphics and video: ‘sudo apt install inkscape gimp kdenlive’
    • Audio: ‘sudo apt install linux-lowlatency audacity fluidsynth patchage’
    • Shell multiplexer: ‘sudo apt install tmux’
    • Virtual machine: ‘sudo apt install virtualbox’
  • Copy files:
    • Connect the old disk to the computer with the USB-to-SATAIII casing and mount it
    • I am trying to avoid getting broken confs from the old machine so only conf file I will take is in /media/username/UUID/username/.config/kdenlive. I used cp command in the shell to get it
    • Copy all files and directories from your old home directory to the new home directory, tick “apply to all” and select “write into” when it asks what to do with directories that exist.
    • Copy any other files you need. Unmount the external drive and remove and put in a cool and dry place.

Kansalaisaloiteluonnos: Salamallintamisen kieltäminen

Kansalaisaloiteluonnos salamallintamisen kieltämiseksi

Salamikä?!??!

00-luvun alkupuolelta lähtien on tullut (lähestulkoon) mahdottomaksi erottaa liikkuvissa ja liikkumattomissa kuvissa mikä on ihmisen kuva joka on kuvattu (elokuva)kameralla ja mikä taas on simulaatio/mallinne ihmisen kuvasta joka on kuvattu simulaatiolla kamerasta.

Kun kameraa ei ole olemassa mutta simulaatiolla kuvattava kohde näyttää erehdyttävästi ihmismuotoiselta on kyseessä digitaalinen kaksoisolento (digital look-alike).

Nyt sama on käymässä meidän äänillemme eli ne kyetään varastamaan esim. Syksyllä 2016 esitellyillä prototyypeillä Adobe Voco:lla tai DeepMind WaveNet:illä ja laittaa sanomaan mitä tahansa. Kun ihmiskokein ei pystytä enään eroittamaan mikä on ihmisen ääni ja mikä simulaatio ihmisäänestä on kyseessä digitaalinen kaksoisääni (digital sound-alike)

On siis aika toimia ja kieltää salamallinnus.

9 images showing various techniques on a model derived interactively from a single photo

Kuva : Muovattavan mallin sovittaminen yhteen ainoaan kuvaan (1) tuottaa 3-D approksiaation (2) ja tekstuurikaappauksen (4) 3-D malli renderoidaan takaisin kuvaan lihonneena (3) laihtuneena (5) ilmeensä nyrpistäneenä (6) ja pakoitettuna hymyilemään (7)
Kuva 1. Copyright ACM 1999 – http://dl.acm.org/citation.cfm?doid=311535.311566 – Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page.

Splitting reflected light to diffuse and specular components was not complicated
Original image Copyright ACM 2000 – http://dl.acm.org/citation.cfm?doid=311779.344855 – Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page.

Elokuvasaleissa olemme voineet nähdä digitaalisia kaksoisolentoja jo reilusti yli kymmenen vuotta. Näillä digitaalisilla kaksoisolennoilla on “vaatteita” (simulaatio vaatetuksesta ei ole vaatetusta) tai “supersankariasuja” sekä “superpahisasuja”, mutta valitettavasti organisoituneet rikollisliigat joilla on tämä asekyky käytössään levittävät sameassa internetissä tuhoisin seurauksin alastomia digitaalisia kaksoisolentoja ja epäluonnollisesti niiden välisiä “fyysisiä” vuorovaikutustilanteita. Nämä teollisesti tuotettavat harhat aiheuttavat inhimillistä ja yhteiskunnallista kärsimystä ja niiden kiellettävissä olevat osaset tulisi kieltää lailla kansalaisten suojelemiseksi rikollisliigojen mielivallalta.

Anekdotaalisesti voidaan todeta: “Luulet(te)ko että tuo oli Hugo Weavingin vasen poskiluu jonka Keanu Reeves löi sisään oikealla nyrkillään?” (Video linkitetty alempana, skrollatkaa)

Katsaus nykyiseen asiaa sivuavaan lainsäädäntöön

Suomen lain Rikoslain 24 luku Yksityisyyden, rauhan ja kunnian loukkaamisesta sisältää salamallintamisen tuhovaikutuksia sivuavia pykäliä muttei valitettavasti anna ongelman ratkomiseen virkavallalle tarpeellisia välineitä.

  • § 6 Salakatselu
  • § 7 Salakuuntelun ja salakatselun valmistelu
  • § 8 Yksityiselämää loukkaava tiedon levittäminen
  • § a 8 Törkeä yksityiselämää loukkaava tiedon välittäminen
  • § 9 Kunnianloukkaus
  • § 10 Törkeä kunnianloukkaus

Lakiehdotus salamallintamisen kieltämiseksi

§1 Ulkonäön salamallintaminen.

Ihmisen kolmiulotteisen mallin sekä tälläisestä muodostetun 7-ulotteisen¹ kaksisuuntaisen heijastavuusjakaumafunktiomallin tai vastaavan mutta teknisesti erilaisen mallin salaa hankkiminen eli ulkonäön salamallinnus sekä tälläisen mallin hallussapito, ostaminen, myyminen, luovuttaminen, maahantuonti ja -vienti ilman kohdeihmisen suostumusta on rangaistavaa.

§2 Salamallien projisoinnista ja näiden saataville tuottamisesta.

Pykälän yksi määrittämistä salamalleista projisointi sekä liikkumattomiksi että animoiduiksi 2-ulotteisiksi kuviksi tai stereokuviksi² sekä tälläisten saataville tuottaminen on rangaistavaa.³

§3 Ihmisäänen salamallintaminen.

Sellaisen ihmisen äänen mallin⁴, joka erehdyttävästi muistuttaa ihmisen ääntä, hankkiminen, hallussapito, ostaminen, myyminen, luovuttaminen, maahantuonti ja -vienti ilman kohdehenkilön lupaa on rangaistavaa.

§4 Ihmisäänen salamallin käytöstä.

Ihmisäänen salamallin pohjalta luodun audiomateriaalin generointi ja saataville tuottaminen on rangaistavaa.


  1. Seitsemän ulottuvuutta ovat seuraavasti: 3 karteesista X,Y,Z sekä 2 valon tulokulmalle ja 2 lähtökulmalle. Enlanniksi termi on “Bidirectional reflectance distribution function”, BRDF. Lisätietoa tutkielmassani joka linkitetty kohdassa “lisälukemista”. Kanavia on kolme R, G ja B joilla voidaan muodostaa teoriassa kaikki mahdolliset valot.
  2. Elokuvateatterikielessä ns. “3-D”. Todellisuudessa ulottuvuus lienee ilmaistava vain 2 kpl 2-ulotteisia tasoja.
  3. Hallussapitäjiä kehoitettaisiin lähinnä ottamaan apua vastaan eikä kriminalisoida.
  4. Kts. esim Adobe Voco ja DeepMind WaveNet. Ei vielä julkisesti kuunneltavana.

Pohjimmaiset saatesanat

Se saattaa olla seitsemänulotteinen ja me ollaan suunnilleen neljässä ulottuvuudessa mutta ne ei pääse siitä 2-D projektiosta ulos jos ei me päästetä sitä enään. Onko täällä kenelläkään mitään poliittista tahtoa yrittää tehdä tälle mitään?


Katseltavaa (vakavasti)

Katseltavaa (enemmän viihteellä)

Lisälukemista


Tämä blogipostaus on Heinäkuun päivitys KANSALAISALOITTEEN laatimista varten. Kun kansalaisaloite on syötetty järjestelmään ei sen sisältöä voi lain mukaan enää muokata joten aloitteen saaminen mahdollisimman hyväsisältöiseksi on elintärkeää ihmiskunnan suojelemiseksi ihmiskunnan pahuudeltaltaan ja tietämättämyydeltään. Kun aloite on jätetty on aloitteen tekijöillä (varaedustaja tarvitaan, frendit voi ilmoittautua vapaaehtoisiksi) on kuusi kuukautta aikaa kerätä ne muut 49 998 allekirjoitusta jolloin eduskunnan on PAKKO käsitellä aloitetta. Mikäli tätä määrää ei saavuteta on kuinkin aloitteentekeminen askel siihen suuntaan että tämä nykyajan teollinen saasta saadaan päivänvaloon ja yhteiskunnalliseen, sekä toivottavasti lainsäädännölliseen keskusteluun mukaan. Aktivoidu ja levitä sanaa.

Translation: Tao Te King – Chapter 81. Proof of simplicity

Chapter 81. Proof of simplicity

Honest words are not high and mighty, mighty and high words are not reliable.

The man of  Tao does not argue.

Statue of Laozi in Quanzhou
Statue of Laozi in Quanzhou 中文: 福建泉州老君岩. Uploaded via Flickr to Commons by Dirrival.

Those who argue are not skilled in the Tao.

Those who know it are not scholars. The scholars don’t know it.

A wise man does not amass treasures.

The more he spends on others the more he himself has.

The more he gives to others the richer he becomes.

This is the heavenly Tao that passes through all things, but offends no-one.

This is the wise man’s Tao that acts but does not fight.

End of the Book of the Way of Virtue


Own translation from 1925 Finnish translation by Pekka Ervast (ISBN 951-8995-01-X) with kind permission of Ruusu-Ristin Kirjallisuusseura ry.

Translation: Tao Te King – Chapter 2. Becoming perfect

Chapter 2. Becoming perfect

When the world speaks of the beauty of beauty then ugliness is defined in the same.

Painting picturing Laozi looking troubled
Laozi is not totally free of the pain of knowledge but knowing the Tao decreases the pain caused by search for information. PD-life-plus-70

When good is seen as good then evil is also immediately clear.

Thus being and unbeing both awaken each other; same as difficult and easy, distant and near, high and low, sounding and tinkling, head of the troop and the follower.

A wise one deals only with what is unprejudiced.

He teaches without using words; he works effortlessly, he produces without owning; he acts without seeking the fruits of labor; he finishes his tasks without borrowing; and as he does not claim anything to be his, it cannot be said that he would ever lose anything.


Own translation from 1925 Finnish translation by Pekka Ervast (ISBN 951-8995-01-X) with kind permission of Ruusu-Ristin Kirjallisuusseura ry.

Translation: Tao Te King – Chapter 80. Standing alone

Chapter 80. Standing alone

If I had a small kingdom and only ten or hundred able men, I would not use them for government.

I would teach the people to view death as a high thing and then they would not go abroad to seek it.

Even if they had ships and carriages, they would not leave with them.

Painting of 2 women mending a fishing net
“Improve the present hour” by Winslow Homer depicting two women mending a fishing net. Uploaded by Davepape. PD-life-plus-100

Even if they had war gear they would never have an opportunity to wear them. The people would return again to using yarn and knots (instead of writing).

They would notice coarse food to be palatable, keep their simple clothing beautiful, see their houses as places of rest and would enjoy their simple entertainments.

Even if nearby there was another state and from there the crowing of the roosters and barking of the dogs sounded, my people would grow old and die without needing to socialize with them.


Own translation from 1925 Finnish translation by Pekka Ervast (ISBN 951-8995-01-X) with kind permission of Ruusu-Ristin Kirjallisuusseura ry.

Translation: Tao Te King – Chapter 79. Keeping promise

Chapter 79. Keeping promise

When agreement has been reached after a long dispute, one side always grumbles. And how could this be said a good resolution to an argument?

That is why the wise one takes his part of the commitment and does not demand anything else for himself.

Picture of even scales made from
Glyph of the Unicode character U+2696 scales, using the font Symbola. CC0 and PD-unicode. Artist and uploader Karl432.

A just man checks only his own obligations in an agreement but the unjust seeks his own profit.

The heavenly Tao has no favorites.

It always helps the good.


Own translation from 1925 Finnish translation by Pekka Ervast (ISBN 951-8995-01-X) with kind permission of Ruusu-Ristin Kirjallisuusseura ry.

Translation: Tao Te King – Chapter 14. Praising emptiness

Chapter 14. Praising emptiness

Smoothness is what cannot be seen when looking at it.

Silence is what cannot be heard when listening to it.

Rarity is what cannot be touched when trying to do so.

As these are inseparable from each other, they can be considered one – Tao¹.

It is not lit in height nor dark at low down.

The Yin and Yang with white representing Yang and black representing Yin.  The symbol is a visual depiction of the intertwined duality of all things in nature, a common theme in Taoism.
The Yin and Yang with white representing Yang and black representing Yin. The symbol is a visual depiction of the intertwined duality of all things in nature, a common theme in Taoism. PD-life-plus-100 SVG Artist: Klem

Boundless in its action, yet nameless. Going out it goes into itself.

This is the manifestation of the non-manifested’s form.

This is the unmeasured mystery. Going in front of it you cannot see its face; following it you cannot notice its back².

Yet directing your life by the old knowledge of Tao is finding the way.


  1. Mr. Ervast: “The text apparently means the absolute divinity (God) that is one with the Holy Trinity Logos (The Word), that cannot be seen, heard or touched, even as it is fullness of the infinite (flatness), eternal sound of silence and rarity i.e. separately manifest worlds, eternity and omnipresence in time and place .”
  2. Mr. Ervast: “The secret of divinity cannot be solved by anyone. He who pretends he is trying, he places himself in front of God supposedly to see his (face) goodness, but in reality he does not see it, but just goes backwards farther away from God. Or  if he doesn’t set³ himself bigger than God, but tries in a way by prying, looking and seeking to gain the secrets he will not even notice the back, he does not distinguish evil from good, darkness from light. And like it states in the last verse the way to God is discoverable.”
  3. Translator’s notice: There could potentially be a typo here. Finnish text does say “asetu” (to place [self]) whereas “aseta” (to place [God]) would make sense. Gotta check this in Chongwen some day.

Own translation from 1925 Finnish translation by Pekka Ervast (ISBN 951-8995-01-X) with kind permission of Ruusu-Ristin Kirjallisuusseura ry.

 

Translation: Tao Te King – Chapter 8. The inexpensive nature

Chapter 8. The inexpensive nature

Image of the Spout Falls, Liffey, Tasmania
Image of the Spout Falls in Liffey at 41° 41′ 54.97″ S, 146° 45′ 44.52″ E (Tasmania) . CC-BY 3.0 by artist and uploader JJ Harrison

Greatest virtue is like water.

Water is good for everything.

It can pass through to even the most unreachable places effortlessly.

That is why it is like the Tao.

It is virtuous like the heart by being deep.

By exposing itself it has the virtue of love.

It is virtuous like speech being trustworthy.

It is virtuous like like the government cleaning and arranging.

It is virtuous like a servant in his ability.

It is virtuous, like action, by always arriving at the right moment.

And because it does not compete, it does not have enemies.


Own translation from 1925 Finnish translation by Pekka Ervast (ISBN 951-8995-01-X) with kind permission of Ruusu-Ristin Kirjallisuusseura ry.

Translation: Tao Te King – Chapter 6. The origin of beings

Chapter 6. The origin of beings

Photoshopped version of a 1972 photo
Color corrected version of a 1972 photo “The Blue Marble“. NASA images are PD unless otherwise noted.

Like the stream of the valley never dries, so the basic essence of the existing never dries.

I call it the Mother-depth.

The movement of the Mother-depth I call the parturient of the heaven and the earth.

Forever it stays, and moves without destination¹.


  1. Mr. Ervast: “This reminds us of the Indian sankhya-philosopy’s understanding of prakriti i.e. the female eternally creative basic essence.”

Own translation from 1925 Finnish translation by Pekka Ervast (ISBN 951-8995-01-X) with kind permission of Ruusu-Ristin Kirjallisuusseura ry.