Extension:Offline/Install

You have the choice to install mediawiki and the offline extension yourself, or download a binary package preconfigured for standalone use.

See the Extension:Offline overview for what to add to LocalSettings.php. Visit the Special:Offline page for status and diagnostic hints once your system is running.

a) Linux
 * Dependencies: yum install php xapian-core xapian-bindings php-pecl-apc

b) Windows
 * The windows package comes with all dependencies locally installed, but you might still have to take these steps: copy zlib1.dll C:\windows\system32\
 * You need the MSVC 2008 Runtime compatibility library.
 * If you are not using the bundled mongoose webserver and php, you will need to include windows/php.ini during php startup.

c) MacOS For example: PHP_CONFIG=/usr/local/php5/bin/php-config XAPIAN_CONFIG=/usr/local/bin/xapian-config ./configure --with-php
 * If you are running MacOS 10.4, you will need to upgrade to php5, installing it into `/usr/local` is recommended. Install the "apc" accelerator and xapian php binding, and enable in `php.ini`.
 * Somehow install the xapian library.
 * you may need to edit "-Wstrict-null-sentinel" out of xapian's configure script, and recompile the indexer.
 * You might also need to deal with `ld.config` and `ldd`.

YOUR ENCYCLOPEDIA and its INDEX
Install an xml dump of your wikipedia, probably distributed in a file named `pages-articles.xml.bz2`, from a disc or the net. Check in often with bittorrent networks. Try to download the corresponding index files, in any of the formats (well only Xapian for the moment). Otherwise, you will have to generate the index yourself, read on brave soul. An index is necessary to match a given article with its location in your dumpfiles.

(You can get a small, pre-indexed encyclopedia for testing purposes from yours truly, wiki-splits-tl.zip for example.)

Extract, then either create a link ln -s ~/wiki-splits-tl/ wiki-splits or rename your database dump directory to `./wiki-splits`

Of course, you can always edit `mediawiki/LocalSettings.php` and set the `$wgOfflineWikiPath` variable to point to another directory.

Hint, your files should look something like this:

drwxrwxr-x. 7  4096 Jan 20 16:13 hiawatha lrwxrwxrwx. 1     8 Jan 20 16:01 hiawatha-7.4 -> hiawatha drwxrwxr-x. 2  4096 Jan 21 18:03 indexer -rw-rw-r--. 1  1894 Jan 21 19:45 INSTALL drwxrwxr-x. 14  4096 Jan 21 17:55 mediawiki-1.16.1-sa -rw-rw-r--. 1  1155 Jan 21 15:48 README -rw-rw-r--. 1 210437 Jan 20 15:41 test_article.xml lrwxrwxrwx. 1    14 Jan 19 21:55 wiki-splits -> wiki-splits-es drwxrwxr-x. 19 266240 Jan 19 20:39 wiki-splits-en drwxrwxr-x. 3 237568 Jan 19 22:11 wiki-splits-es drwxrwxr-x. 4 12288 Jan 21 17:20 wiki-splits-tl

If you have downloaded an index compatible with this software, pat yourself on the back! Otherwise, you are now ready to run the indexer on your dump. You may have to count to 3,000,000. The index can be validated immediately, if you want to verify the process is going along smoothly. Hint: try an article beginning in "A".

cd indexer ; make index

SERVE THE PAGES
You should have received a bundle including a portable web server for your platform. Or, you can run your own just as well. Follow the instructions below and head a browser to port `http://127.0.0.1/8000`

You are now running the same software as da Big One, not an imitation!

If you need to install a web server, pick one capable of last-updated caching and php cgi. FastCGI support is easy and will make you happy. For example, to install "hiawatha":

wget http://www.hiawatha-webserver.org/files/hiawatha-7.4.tar.gz tar xzf hiawatha-7.4.tar.gz  cd hiawatha-7.4 ./configure --prefix=`pwd`/../hiawatha/ --disable-ipv6 --disable-ssl --disable-xslt && make

cd wikipedia-offline-patch/ vi config/hiawatha.conf ...then do :%s/WebsiteRoot//g cp config/hiawatha.conf hiawatha/etc/hiawatha/

php-cgi -b 2005 < /dev/null &
 * 1) run a FastCGI server.  Otherwise, edit the conf file to disable.


 * 1) Start hiawatha (running on port 8000 by default)

./hiawatha/sbin/hiawatha

Or, to use another web server such as Apache, edit your config and add:

DocumentRoot mediawiki-1.16.1-sa/ /wikipedia-offline-patch/mediawiki-1.16.1-sa> # enable the rewriter RewriteEngine On   RewriteBase /wiki # anything under /wiki is treated as an article title, unless it is a file RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/(.+)$ index.php?title=$1 [PT,L,QSA] 

=Plans for an Automated Installer=
 * Select content manager (similar to the books project?) to modify; hook appropriate dump import code
 * Configure languages
 * Download from dump directories
 * generate LocalSettings.php lines to read from configured sources, or web-writeable configuration?