MediaWiki/archive/mirroring on a laptop

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< MediaWiki‎ | archive
Revision as of 23:37, 14 December 2017 by Woozle (talk | contribs) (→‎Copying the site: updated internal link)
Jump to navigation Jump to search

Navigation

computing: software: MediaWiki: mirroring on a laptop

Overview

For reasons which I'll explain later, I wanted to have a copy of one of my wikis on a laptop so I could refer to it in a situation where I might not have Internet access. This meant installing Apache, PHP, and MySQL, and getting them all working together – things which are more commonly handled by the web hosting service – so it may be useful to make notes about what happened.

This page is still in progress, as I haven't got the installation completely working yet.

The Environment

I started with Ubuntu 6.06 running on a Sony Vaio F650 laptop (Intel P3-600, 128 MB).

Things to install (I used Synaptic for these):

  • Apache
  • MySQL
  • php5
    • php5-mysql, the MySQL module for PHP 5

Copying the site

Download a copy of your MediaWiki installation (so you are using the same version), and export the database to a .sql file.

Tidying up

I haven't been able to figure out the necessary configuration mods to port a site which was at http://domain/ to http://machinename/subdir; I wasn't able to get the rewrite engine to act like it was working. What I did finally do that worked is upgrade to the latest MediaWiki, which generated fresh configuration files. (Reinstalling the same version should work too.) Things to remember:

  • Save your image folder (I call mine "wikiup", for wiki uploads, to distinguish it from the images used by MediaWiki)
  • Make sure your image folder globally-writable (chmod 777 wikiup) so MediaWiki can write thumbnails and new images
  • Change the $wgUploadPath and $wgUploadDirectory settings in LocalSettings.php so they point to wikiup (or whatever you call yours)
  • Save any skins/ modifications or custom skins so you can restore them -- especially your wiki's logo
  • Be sure to copy your backed-up wikiup folder back where it belongs, after modifying LocalSettings.php and before trying to access any images (if you try to access images when they're not there, the database will become confused and may require a maintenance script to be run -- more about this later when I have a chance)