fredag 23 januari 2009

Generate static version of mediawiki site

Here are some random notes on how to generate a static dump of a mediawiki site
  1. Download the DumpHTML.php extension:
    cd /var/tmp/
    svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/DumpHTML
  2. Copy the extension to the mediawiki installation (mine is in /var/lib/mediawiki, I use the packaged version for Debian Lenny).
    Become root.
    cp -r /var/tmp/DumpHTML /var/lib/mediawiki/extensions/
  3. Decide where to put the content (I use /var/www/staticdump here) and call the script:
    php /var/lib/mediawiki/extensions/DumpHTML/dumpHTML.php -d /var/tmp/staticdump --image-snapshot --force-copy --no-overwrite
Then my other web server (not apache, which serves mediawiki) can show the pages in /var/tmp/staticdump which is a lot faster than generating them with php.
The drawback is that some pages are not generated, such as the page listing all pages on the wiki.

The manual page for the extension is here: http://www.mediawiki.org/wiki/Manual:DumpHTML.php

Inga kommentarer: