administrators (intermediate) WikiFarms are a mechanism for running multiple independent wikis on the same web server from a single PmWiki installation. A WikiFarm is a collection of independent wikis, and each independent wiki in the farm is commonly called a WikiField. A person who manages the PmWiki software installation is commonly called a farm administrator. A person who manages an individual WikiField is called a field administrator. The location of the PmWiki software is called the farm directory and the location of each individual field is called a field directory. Each field must have its own URL so that PmWiki can distinguish which field is being accessed, but can share pages, groups, uploads, page templates, passwords, and other local customizations with other fields. For a quick explanation of what goes where and what it controls, see PmWiki:QuickFarms. The remainder of this document describes how to setup WikiFarms and individual fields of the farm, and assumes you are already somewhat familiar with the details of PmWiki installation. Setting up a WikiFarm (farm administrator)Any PmWiki installation can become a WikiFarm. The farm administrator creates a local/farmconfig.php file in the “farm directory” (the directory in which pmwiki.php is installed). This file would contain any local customizations that are to be performed for every field in the farm (farmconfig.php is analogous to the config.php file of a typical installation). Usually, this will mean setting <?php if (!defined('PmWiki')) exit(); $FarmPubDirUrl = 'http://www.example.com/pmwiki/pub';
Your PmWiki installation is now set up for farming. Now you need to create fields to see it in action. Note: Depending on your setup, you may want to install PmWiki in a non-web-server-accessible location. If you don’t, or can’t, you may want to control access using .htaccess. See Cookbook:FarmSecurity for more info.
Setting up a field within the WikiFarm (field administrator)Once PmWiki has been set up for WikiFarming, a new field is created by doing the following: 1. Create a directory to hold the field. Normally the field directory goes in a web-accessible directory (e.g., under public_html), but it can be placed anywhere that a PmWiki installation would normally go. 2. Create a PHP script (e.g., field.php or index.php) in the field directory with the following line <?php include('path/to/pmwiki.php’); where Note that it’s not sufficient to use symbolic links or file shortcuts to connect to the farm installation of pmwiki.php; one must use an include statement in order for PmWiki to be able to correctly determine the location of the farm’s scripts/ and other directories.
3. Follow step #3 of the installation procedure to create the the field wiki’s wiki.d/ directory. Local customizations in fields and farmsEach field administrator can create a local/ directory within the field directory for local customization to be applied to the field. This works just like a normal PmWiki installation—the file local/config.php holds settings for the entire field, and files of the form local/Group.php and local/Group.PageName.php are used for per-group and per-page customizations (see GroupCustomizations). The PmWiki variable A farm administrator can use the local/farmconfig.php file for customizations to be applied to all fields within the farm. By default, farm customizations are performed before any field-customization files; however, the farm administrator can override some field-customizations by explicitly calling the field’s config.php files (this effects all fields), as in: <?php if (!defined(‘PmWiki’)) exit(); # Settings performed before field-customizations If extension scripts are used farm-wide and they are located in the farm’s cookbook directory they should be loaded through entries in local/farmconfig.php like: Notes
This page may have a more recent version on pmwiki.org: PmWiki:WikiFarms-Old, and a talk page: PmWiki:WikiFarms-Old-Talk. |