Local wiki installation

One of my clients wanted to build a fully searchable warehouse of all their IT information – releases, projects, programs, developers, etc. Given that the users for this interface were going to run the gamut between management and engineers, I needed something that everyone could be comfortable with. Since everyone uses Wikipedia for something anymore, that seemed like a good choice.

When I presented the concept to my client, they were initially guarded. The data they wanted to make available was highly proprietary and they didn’t even want to risk it being made available to an unintended audience.

Enter the concept of the local installation of Wikipedia using the MediaWiki software. Using an older Windows XP PC in their office, I was able to build and configure the solution for them in a very short period of time. There was a little trouble-shooting here and there, but for the most part the process was painless.

In order to host a Wiki, there are several prerequisites:

  • the PC or server in question has to be configured as a web server
  • PHP scripting must be available
  • a database engine (like MySql) must be installed
  • install and configure the MediaWiki software

Let’s walk through each of these steps.

Install Apache

Visit the Apache Software Foundation to download the latest stable version of the Apache Web Server. The one that I used for my installation was httpd-2.2.16-win32-x86-no_ssl.msi

Install PHP

Visit The PHP Group to download the latest stable version of the PHP Pre-processor. Based on recommendations from various web sources, I selected the VC6 thread safe version (php-5.3.3-Win32-VC6-x86.msi). While I was moving through the installation options, I elected to install the PHP folder directly under the drive root (c:php). This had been recommended for stability in the file path and seemed like a reasonable recommendation.

Configuring PHP

The installation of the PHP software is only the first step. In order for PHP and Apache to work and play well together, there are some changes that need to be made to the configuration files.

Christopher Heng posted a very informative article on thesitewizard.com entitled “How to Install and Configure PHP 5 to Run with Apache on Windows“. Using that article as a guide, I changed my configuration as follows:

Open the configuration file
  • Locate your Apache configuration file (httpd.conf) under the path “C:Program FilesApache Software FoundationApache2.2conf”
  • Create a backup copy of the configuration file
  • Open the httpd.conf file for editing by using a simple text editor like Notepad
LoadModule
  • Scroll down until you see statements beginning with LoadModule. Please note that the ‘#’ symbol designates a comment, so if you found #LoadModule you’re in the right place
  • Add the statement: LoadModule php5_module “c:/php/php5apache2_2.dll”
  • Navigate to your PHP folder and confirm that php5apache2_2.dll is in that folder. If it isn’t, there is either a problem with your installation, or there may be a similar DLL there. The end result is that the DLL mentioned in the LoadModule statement should be found in the path specificed
AddType
  • Scroll down until you see statements beginning with AddType.
  • Confirm that these lines are within the mime_module section of the configuration
  • Add the statement: AddType application/x-httpd-php .php
DirectoryIndex
  • Scroll or search for the line that reads: DirectoryIndex index.html
  • Change that to read: DirectoryIndex index.php index.html
PHP.ini
  • Scroll all the way to the bottom of the file
  • Add the statement: PHPIniDir “c:/php”

You can now save and close the httpd.conf file.

Testing

We can create a simple PHP script to make sure everything works correctly.

  • Open a new Notepad window
  • Add the line:
  • Save and close the Notepad file to the htdocs directory under your Apache folder. This is your web root folder. Save the file as something like testphp.php
  • Restart your Apache service
  • Open the page http://localhost/testphp.php

You should see a PHP information page. If so, then you have successfully paired PHP and Apache!

Install MySQL

mysql-5.1.51-win32.msi

Configure via instructions from:

http://www.mediawiki.org/wiki/Manual:Streamlined_Windows_Install_Guide#MySQL

Install MediaWiki

mediawiki-1.16.0.tar.gz

Configure via instructions from:

http://www.mediawiki.org/wiki/Manual:Streamlined_Windows_Install_Guide#MediaWiki

Comments are closed.