Building a WikiFarm with ewiki

The advantages of a WikiFarm are easy updating of one central installation for all the depending wikis and comfortable creation of new individual wikis. They can have their own content in an individual database table and their own look and feel with individual configuration and css files. The WikiFarm can be built in separate folders with a few modifications in some files as described below. My tests on a local xampp installation worked perfect, but I’m not certain, if everything is ok. Can anybody please verify my approach?

The central installation

Make a complete installation in a directory named for example "wiki". Delete the following files index.php, config.php and all css files, the directory init-pages und the pictures.

Pages in the central installation, that have to be changed for the WikiFarm:

  • plugins/spages.php - from line 28
#-- specify which dirs to search for page files
ewiki_init_spages(
   array(
      "../wiki/spages",
   )
);
  • ewiki.php – from line 101
        #-- database - the table name must be defined in the individual config.php
        //@define("EWIKI_DB_TABLE_NAME", "ewiki");        # MySQL / ADOdb


For every individual wiki

Save the following files in one separate folder for every wiki: index.php as the individual wrapper, config.php with the individual configuration, the css file/s, the folder with the init-pages and all used pictures. Every individual wiki should use a separate data table in the database. The links in config.php to the plugins and the ewiki.php start with a relative path "../wiki/" - all include und require url’s start with "../wiki/" too. For example you save the following files in the individual wiki folder:

  • index.php
  • config.php
  • wiki.css
  • init-pages/
  • banner.png


Files in the individual wiki directory that have to be changed for the WikiFarm

  • config.php – add before line 26 for example
#-- database
@define("EWIKI_DB_TABLE_NAME", "indiwiki1");        # MySQL / ADOdb


The file hierarchy in the documentroot of the webserver could look like:

wiki/
    examples/
    fragments/
    images/
    init-pages/
    plugins/
    spages/
    tools/
    ewiki.php
    z.php
    ...
indiwiki1/
    init-pages/
    banner.png
    config.php
    index.php
    wiki.css
    ... 
indiwiki2/
    init-pages/
    banner.png
    config.php
    index.php
    wiki.css
    ...


The wiki administration

To be able to administrate every single wiki, the "tools" directory must be copied into every single wiki directory.

Pages in the individual “tools” directory that have to be changed for the WikiFarm

  • tools/t_config.php - from line 27
     #-- simplest authentication:
     require("../../wiki/fragments/funcs/auth.php");

-- *UrsHunkler 2004-10-29

MarioSalzer: I stumbled across the same problem. Maybe a tools.php/ wrapper evaluating the PATH_INFO was easier to use in the first place. Whatever, this page makes a good introduction to what after should be very easy with ewiki. I'm tempted to take it as new add-on documentation as is.

*UrsHunkler: Feel free to do so. Aren't there any hidden stumbling blocks? Is it really that simple to get a WikiFarm running ;-)

jbw: actually I found it even simplier by adding the wiki directory to the php include path, this way needed no code changes, and all I need to duplicate is the index.php and logo and css files. I just updaded from 1.01d to 1.02a and the changes needed were all due to the db interface update, nothing different due to the fact I had a wikifarm. There are a few more things that should be definable to let each wiki better control its messages on the edit screen though.

I need some tipps how to simply handle the changes after a software update. Any suggestions?

--*UrsHunkler 2004-10-31

MarioSalzer: Sure, we need an *UpgradingHowto or something that way. Basically it goes by unpacking everything into a wiki/ or ewiki/ directory, and keeping all personal changes and tweaked plugins in a ewiki/local/ directory, so nothing gets lost, if you overwrite everything with a newer version.

Jochen: For some (paranoid) reason I place the ewiki scripts and all content (flat files) outside the html tree like this:

/usr
  /files
    /ewiki
      /fragments
      /plugins
      /spages
      ewiki.php
    /mywiki-1-content
    /mywiki-2-content
  /html
    /mywiki-1
      config.php
      index.php
      wiki.css
    /mywiki-2
      config.php
      index.php
      wiki.css
bottom corner