blob: 3a4fbf36673dfec953c63f141e0beb20dea433e0 [file] [log] [blame]
text=WikiFarms are a mechanism for running multiple independent wikis from a single PmWiki installation. If a [[WikiFarm(s)]] is a collection of independent wikis, then each wiki in the farm is commonly called a ''`WikiField''. A person who manages the PmWiki software installation is commonly called a ''farm administrator'', while any administrators of individual fields are called ''field administrators''. Each field can have its own base URL, set of pages and WikiGroups, uploads, page templates, passwords, and other [[local customizations]]. ²²Most importantly, software [[upgrades]] to the (single) farm installation automatically upgrade all of the fields in the farm. In addition, customizations can be made and controlled at the farm level, to be applied to and used by all of the fields in the farm.²²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(s)]] (farm administrator)²²Setting up a PmWiki installation to act as a [[WikiFarm(s)]] is fairly straightforward. The farm administrator simply creates a ''local/farmconfig.php'' file with any [[local customizations]] that are to be performed for every field in the farm. Usually, this will mean setting $FarmPubDirUrl to reasonable settings for the new field. A minimal ''farmconfig.php'' file might look like:²² <?php² $FarmPubDirUrl = [=''=];² ?>²²$FarmPubDirUrl is used to provide fields with the URL location of the farm's ''pub/'' directory, and $PageTemplateFmt is changed to be a shared "farm" version of the default layout. (The only real difference between the normal template and the farm template is that the farm template uses $FarmPubDirUrl instead of $PubDirUrl in the .css files.) ²²That's all there is to it--your PmWiki installation is now set up for farming!²²!!!Setting up a field within the [[WikiFarm(s)]] (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'') in the field directory with the following line²² <?php include([='=]''path/to/pmwiki.php'''); ?>²²where ''path/to/pmwiki.php'' is the path to the farm's installation of PmWiki.²²->%note% Note that it's not sufficient to use symbolic links or file shortcuts to connect to the farm installation of ''pmwiki.php''; one has to 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. Change the field's directory permissions to 2777.²²4. Open a web browser and execute the ''field.php'' script you created in step #2. This will create the needed directories for the field and should bring up a default PmWiki installation (with any default settings the farm administrator may have set).²²²!!!Local customizations in fields and farms²²Each field administrator can create a ''local/'' directory within the field directory for [[local customization(s)]] 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 PerGroupCustomizations).²²Within a field, the PmWiki variable $FarmD is set to the "home directory" for the PmWiki farm installation, thus an administrator can use ''$FarmD/scripts/'' and ''$FarmD/pub/'' to refer to the farm's ''scripts/'' and ''pub/'' directories.²²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 file, as in:²² <?php² # Settings performed before field-customizations² $FarmPubDirUrl = '';² $Skin = 'pmwiki-farm';²² # load the field's global and per-group customizations² include_once('local/config.php');² include_once('local/pgcust.php');²² # Override field customizations here² $EnableUpload = 0; # disable uploads² ?>²²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:\\² [@include_once("$FarmD/cookbook/scriptname.php");@]\\²similar includes can be done in any field's local/config.php file. Note the double quotes "...", single quotes do not work.²²!!!Notes²²* Field directories can also contain local ''pub/'' and ''uploads/'' directories. A per-field ''uploads/'' directory will normally be created in the field directory if uploads are enabled (see UploadsAdmin).²²* Pages distributed with PmWiki (e.g., documentation) are automatically shared among all fields in a farm. This is controlled through the $WikiLibDirs variable, which defaults to looking in the farm's copy of ''wikilib.d/''.²²* The file ''farmmap.txt'' in the farm's ''local/'' directory can be used to provide farm-wide InterMap links. This may be useful for creating links to pages in other fields of the farm.²²* In general, fields can be created and administered from user accounts other than the one maintaining the farm if the underlying operating system permissions and PHP configuration settings allow it. PHP's default configuration normally allows this, but some system administrators and web hosting services change the PHP configuration such that this is not possible.²²%trail% <<|PmWiki.DocumentationIndex|>>²
agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; NetCaptor 7.5.2; .NET CLR 1.0.3705)