Install Wikipedia Locally

I theoretically mentioned the fact that it was possible, and in fact quite easy, to install Wikipedia locally which has several advantages but also one disadvantage. Advantages should be clear; You do not need a net connection to access the Wikipedia contents, you can distribute the solution to as many computers as you want and you can make it available in a local area network.

The only disadvantage that I can think of is that you will not use the latest version on their website and that you have to update the database to keep up to date. The English database file has a size of more than 3 Gigabytes – packed that is – and it can take some time to download it depending on your Internet connection.

I did use a download manager to make sure that the download does not get interrupted and I have to start over again. Here is the list of files that you do need, I walk you through the installation afterwards:

  • Wikipedia Database Snapshot – the file needed is currently called enwiki-latest-pages-articles.xml.bz2
  • An Apache server. I did use the free XAMPP to install it on my Windows system.
  • Wikifilter – the script that makes Wikipedia available in the Apache server.

I suggest you start by downloading the files needed. The Wikipedia database download will naturally take longer than the other two downloads which is excellent for our purpose. Once XAMPP has been downloaded install it. You are asked if you want to add services to your system during installation, this is not needed. Make sure you start the XAMPP control panel afterwards.

apache server

Keep this open and wait for the downloads to finish. Now unpack the file that contains the Wikipedia articles and wait for it to finish. The unpacked file has a size of more than 13 Gigabytes so make sure you have enough free hard drive space on that drive.
Now add the date of the release in the format YYYYMMDD to the file name. I added it at the end before the .xml.

wiki index

Now run WikiIndex.exe and drag and drop the XML file in the program window. It starts indexing the database file which should take a while as well (5 minutes on my system). We are almost done now.

You need to locate the httpd.conf file in the XAMPP directory and add an entry to it. The file is located in xampp\apache\conf. Just open it with a normal text editor and add the following line at the end:

LoadModule WikiFilter_module C:/Program Files/WikiFilter/WikiFilter.so

Please replace the path to the WikiFilter.so file with the path on your system. You should also note that the file path uses / instead of the usual \ to separate directories.

Start Apache using the XAMPP control panel and point your browser to the url http://localhost/wiki/.

Author: Martin Brinkmann
Install Wikipedia Locally

Uncategorized

  1. Daos
    March 12th, 2009 at 15:48 | #1

    “Passing that test does not mean that the browser is able to display all websites correctly.”
    Agree but… This particular test MUST be passed by every browser not to show ‘coolness’ of browser but to just support standard. Supporting standard is a fundamental feature of browsers and if we compare browsers with f.e. 95% and 99% and say 99% is ‘better in supporting standard’ we will be wrong. I think, there is no place for ‘more’ or ‘less’ when we talk about standard. There is only ’standard’ and ‘non-standard’.
    So if browser pass Acid3 this not means it is ‘perfect’ but if it can not complete this test it really means this browser is ‘not perfect’.
    IMHO :)

    P.S. More tests = more progress, I think.
    But as said above – passing test is not big deal to make decisions in words ‘which browser is BETTER’…

  1. No trackbacks yet.