Topics |
PmWiki > Wiki Farms
administrators (intermediate) A WikiFarm is a collection of two or more wikis running on the same web server and sharing a set of common components. The term is based on the computing phrase "server farm". This page provides some background information about Wiki Farms and describes how to turn a "normal" configuration into a farm by adding a wiki. There are many ways to configure wiki farms; this page describes only one, in an effort make it as simple as possible for the administrator who is creating a farm for the first time. Why use a farm?The primary motivation for using a wiki farm is to reduce the amount of administrative work involved in managing several wikis. In a farm, most of the Pm Wiki code is stored in one place and is shared by all the wikis. An administrator can (for example) upgrade to a new version of Pm Wiki on every wiki in the farm by simply updating the shared components in a single location. From a reader's point of view, each wiki in a farm is completely independent, and appears as a separate web site. Each wiki in a farm:
Why not to use a farmBecause the wikis in a farm are all independent, it is difficult (but not impossible) to provide services that require access to more than one wiki. For example, the Pm Wiki search function can only search within one wiki. Using a farm as a way of subdividing related content is generally a bad idea. A much better way to subdivide content is to use WikiGroups. I still can't decide if I need a farm ...The good news is that you don't have to decide in advance. In fact, the recommended procedure is to first do a "normal" or single installation of Pm Wiki. Use it for a while. Create pages and edit them. Get to know how to add recipes. Be sure to try out WikiGroups (they may be all you need). Once you have decided that you need another wiki, you have two basic choices:
Choice number 1 can be a good choice for several reasons:
If you choose to create a wiki farm, then read on ... PrerequisitesBefore you create a farm, make sure that:
Creating the home wikiYou do have a working installation of Pm Wiki at this point, don't you? That's good, because your existing wiki is about to become the home wiki of your farm. In the directory that contains your existing wiki, create the file local/farmconfig.php. This file is used to hold any customizations that apply across the whole farm. For example, you could assign an admin password in farmconfig.php that will be used by all of the wikis in your farm. If the URL used to access your existing wiki is http://www.example.com/pmwiki/ then a minimal farmconfig.php file would look like this: <?php if (!defined('PmWiki')) exit(); $FarmPubDirUrl = 'http://www.example.com/pmwiki/pub'; This loads the variable Amazing as it may sound, this completes all of the changes you need to make in order to turn your existing wiki into the home wiki of your farm. Creating an additional wiki in your farm1. Create a directory to hold the new wiki. This directory must be web-accessible, just like the directory that holds your home wiki. 2. Create a file called index.php in the directory with the following contents: <?php include('path/to/pmwiki.php'); This allows your new wiki to share the Pm Wiki code stored in your home wiki. The 3. Open a web browser and browse the URL of the new wiki. This will be a web address starting with ' Your new wiki is now set up, and your farm now contains 2 wikis. To add more wikis, just repeat these 3 steps. CustomizationEach wiki in a farm inherits the settings stored in farmconfig.php. Do any customization that you want to apply farm-wide (to all the wikis) in farmconfig.php. Create a local/ directory within each wiki's directory to hold local customization that apply only to that wiki. Farm-wide customizations are processed before the individual wiki local customizations. The Pm Wiki variable
Notes
This page may have a more recent version on pmwiki.org: PmWiki:WikiFarms, and a talk page: PmWiki:WikiFarms-Talk. |