Assembla home | Assembla project page
 

Most of you will only want the webapp and download prebuilt data files.

Prerequisites

On your desktop - only if you generate the data files yourself

If you download the ready-made ones you don't need to worry.

  • Perl (on Windows you can use ActivePerl)
  • Windows users will also need the binaries attached below, windepends1.zip and windepends2.zip to get the following, which should be already installed for Linux users:
    • The bzip2 binaries, namely bzcat and bzip2recover
    • The GNU sort executable (do NOT use the Windows one).
    • Some Perl modules (generally provided in most perl distros): Encode, File::Copy, Digest::MD5, HTTP::Request, LWP::UserAgent (ACtivestate has them all so you shouldn't worry too much about that)
  • Optional: the XML dump of your choice from wikimedia. Take the standard one without images and page history (pages-articles.xml.bz2). The indexer can also download it automatically when used with --download option.
  • Optional: To support Math notations, LaTeX with dvipng. Windows users can get it from ProTeXt

On the iPhone

  • Apache
  • PHP - check out this guide to make both work together
  • Perl (the wiki parsing and HTML rendering was not possible in pure PHP because PCRE functions do not work)

Step 1: Copy the web app

  • Download the PHP web app in wiki.zip below and unzip it somewhere
  • Copy the wiki folder in /Library/WebServer/Documents, so that you should have access to http://127.0.0.1/wiki/search.php

Optional Step 2: Create the data files

Now that you have the basics, let's create the data files. If you don't want to bother just download one of the torrents I'm providing in DataFiles and go to step 3.

  • Download the perl indexer below in a working folder (let's call it <rootFolder>). E.g. d:\iphonepedia
  • Windows users should unzip the content of windepends1.zip and windepends2.zip in the same folder
  • Create a new language folder in it <rootFolder>/<lang> (e.g. d:\iphonepedia\en)
  • Create <rootFolder>/<lang>/bz2 and place the wikipedia dump file in it.
  • Run the indexer with the command perl makeindex.pl from a command prompt from the working folder. It takes one argument, the root folder path makeindex.pl <rootFolder>. It will create the index files in <rootFolder>/db.
  • Go clean your room or do some other ~1 activity for the English dump. French dump takes about 20 minutes.
  • Check that you have all the small archive files created in <rootFolder>/<lang>/bz2. If it's the case, you can safely delete the large unsplit archive file. The script does not do it for you, so that in case anything goes wrong in the process you won't have to re-download the 3Gb file... If you want to keep it, at least move it off this folder. We don't want the file to be copied on the iPhone.

Step 3: Copy the data files

  • Copy the whole <lang> directory in /private/var/root/Library/WebServer/Data (you have to create this folder).
  • The English version has about 15,000 files so it will take a while even if it's only 3Gb.

And this should be it!

Access the world's knowledge from your iPhone at http://127.0.0.1/wiki/search.php If it doesn't work you can try to set the $bDebug flag in /Library/WebServer/Documents/wiki/localconfig.php to true to have some diagnostic information, but I admit my error messages may not always be very informative... Check out the TheFaq.

Attachments