A workgroup may have a wiki associated with it.
For example, see http://chess.eecs.berkeley.edu/ptexternal/wiki

User level website wiki instructions

Choosing a wiki

I chose PmWiki because:
  1. Written in php, so we can access our user db
  2. Looked good and has skins

Resources

  • Top Ten Wiki Engines - by the original Wiki author
  • http://www.wikimatrix.org/ - Helps choose a wiki
  • http://en.wikipedia.org/wiki/Wiki_software - Description of wiki software on wikipedia
  • Upgrading PmWiki

    1. Follow the Generic Instructions here, in particular the Backup, Download and Extract, and Copy steps. The Copy approach will preserve some locally modified files, such as the installed cookbooks and the config files in the local directory.
    2. Don't forget to update http://robotics.eecs.berkeley.edu/mast/wiki/pmwiki.php?n=Main.HomePage
      sudo -i
      su - mastwiki
      cd /projects/sastry/www-pages/home/mast
      
      Then see the README.txt file.
    3. The following steps are needed only if you do not use the Copy approach:
      1. Install the simple and monospace cookbooks, plus any other previously installed cookbooks.
        cd pmwiki/pub/skins
        wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/simple.tgz
        wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/monobook.zip
        gtar -zxf simple.tgz
        unzip monobook.zip
        mkdir stripped
        cd stripped
        wget http://www.pmwiki.org/pmwiki/uploads/Skins/stripped.tmpl
        
      2. Update pmwiki-2.2.83/pub/skins/monobook/monobook.php in two places so that https works
        66,70c66
        <
        < # Use MonobookPubDirUrl so that that https works.  -cxh
        < #$HTMLHeaderFmt[] = "n";
        < SDV( $MonobookPubDirUrl, "$PubDirUrl/skins/monobook" );
        < $HTMLHeaderFmt[] = "n";
        ---
        > $HTMLHeaderFmt[] = "n";
        
        and
        181,185c183
        <
        < # Use MonobookPubDirUrl so that that https works.  -cxh 6/5/15
        < #  $LinkUploadCreateFmt = "$LinkText";
        <   $LinkUploadCreateFmt = "$LinkText";
        <
        ---
        >   $LinkUploadCreateFmt = "$LinkText";
        
      3. Update the local directory.
        pmwiki/local/config.php:
        <?php if (!defined('PmWiki')) exit();
        include_once("wiki.php");
        include_once("$FarmD/cookbook/pagetoc.php");
        include_once("$FarmD/cookbook/expirediff.php");
        
        
        
        $UploadExts['m'] = 'application/matlab';
        $UploadExts['mdl'] = 'application/octet-stream';
        $UploadExts['mat'] = 'application/octet-stream';
        
        $UploadExts['docm'] = 'application/vnd.ms-word.document.macroEnabled.12';
        $UploadExts['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
        $UploadExts['dotm'] = 'application/vnd.ms-word.template.macroEnabled.12';
        $UploadExts['dotx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';
        $UploadExts['potm'] = 'application/vnd.ms-powerpoint.template.macroEnabled.12';
        $UploadExts['potx'] = 'application/vnd.openxmlformats-officedocument.presentationml.template';
        $UploadExts['ppam'] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12';
        $UploadExts['ppsm'] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12';
        $UploadExts['ppsx'] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';
        $UploadExts['pptm'] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12';
        $UploadExts['pptx'] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
        $UploadExts['xlam'] = 'application/vnd.ms-excel.addin.macroEnabled.12';
        $UploadExts['xlsb'] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';
        $UploadExts['xlsm'] = 'application/vnd.ms-excel.sheet.macroEnabled.12';
        $UploadExts['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
        $UploadExts['xltm'] = 'application/vnd.ms-excel.template.macroEnabled.12';
        $UploadExts['xltx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';
        $UploadExts['xml'] = 'application/vnd.moml+xml';
        $UploadExts['odb'] = 'application/vnd.oasis.opendocument.database';
        $UploadExts['odc'] = 'application/vnd.oasis.opendocument.chart';
        $UploadExts['odf'] = 'application/vnd.oasis.opendocument.formula';
        $UploadExts['odg'] = 'application/vnd.oasis.opendocument.graphics';
        $UploadExts['odm'] = 'application/vnd.oasis.opendocument.text-master';
        $UploadExts['odp'] = 'application/vnd.oasis.opendocument.presentation';
        $UploadExts['odp'] = 'application/vnd.oasis.opendocument.presentation';
        $UploadExts['ods'] = 'application/vnd.oasis.opendocument.spreadsheet';
        $UploadExts['odt'] = 'application/vnd.oasis.opendocument.text';
        $UploadExts['otg'] = 'application/vnd.oasis.opendocument.graphics-template';
        $UploadExts['oth'] = 'application/vnd.oasis.opendocument.text-web';
        $UploadExts['otp'] = 'application/vnd.oasis.opendocument.presentation-template';
        $UploadExts['ots'] = 'application/vnd.oasis.opendocument.spreadsheet-template';
        $UploadExts['ott'] = 'application/vnd.oasis.opendocument.text-template';
        $UploadExts['sda'] = 'application/vnd.stardivision.draw';
        $UploadExts['sdc'] = 'application/vnd.stardivision.calc';
        $UploadExts['sdd'] = 'application/vnd.stardivision.impress';
        $UploadExts['sdf'] = 'application/vnd.stardivision.math';
        $UploadExts['sds'] = 'application/vnd.stardivision.chart';
        $UploadExts['sdw'] = 'application/vnd.stardivision.writer';
        $UploadExts['sgl'] = 'application/vnd.stardivision.writer-global';
        
        // See http://www.mail-archive.com/pmwiki-users@pmichaud.com/msg13806.html                                             
        # Provide notnull conditional                                                                                          
        # (:if notnull $Var:)                                                                                                  
        # (:if notnull $Var PageName:)                                                                                         
        $Conditions['notnull'] = 'NotNullCondition($pagename, $condparm)';
        
        
        function NotNullCondition($pagename, $arg) {
          //log_event("pmwiki local/config.php NotNull: <$pagename>, <$arg> ");                                                
          $arg = ParseArgs($arg);
          $varname = @$arg[''][0];
          if (@$arg[''][1]) // pagename                                                                                        
            {
              $pagename = $arg[''][1];
            }
          //log_event("pmwiki local/config.php NotNull: varname: $varname, pagename: $pagename");                              
          $val = PageVar($pagename, $varname);
          if ($val)
            {
              return true;
            }
          return false;
        }
        
        // Need this for the TerraSwarm Quarterly Reports                                                                      
        // http://www.pmwiki.org/wiki/PmWiki/LayoutVariables#MaxIncludes                                                       
        $MaxIncludes = 1000;
        
        ## By default, viewers are prevented from seeing the existence  
        ## of read-protected pages in search results and page listings, 
        ## but this can be slow as PmWiki has to check the permissions 
        ## of each page.  Setting $EnablePageListProtect to zero will  
        ## speed things up considerably, but it will also mean that 
        ## viewers may learn of the existence of read-protected pages. 
        ## (It does not enable them to access the contents of the pages.)
        $EnablePageListProtect = 0;
        
        ?>
        
        
        Note: Don't forget the trailing newline!
        pmwiki/local/farmconfig.php
        <?php if (!defined('PmWiki')) exit();
            include_once('include/util.inc.php');
            #log_event("farmconfig.php: FarmD: $FarmD");                                                                       
            # Settings performed before field-customizations                                                                   
            $SERVER_NAME     = $_SERVER['SERVER_NAME'];
            #$ScriptUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pmwiki.php";                                            
            #$ScriptUrl = "http://$SERVER_NAME/wiki";                                                                          
            $FarmPubDirUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pub";
        
            # load the field's global and per-group customizations                                                             
            include_once("$SERVER_NAME/pmwiki/local/config.php");
            $EnableLocalConfig = 1;
            include_once('local/pgcust.php');
            # Make sure the user can read the wiki. See php/wiki.php                                                           
            wiki_access_auth();
            # Override field customizations here                                                                               
            $EnableUpload = 1;            # enable uploads                                                                     
            $UploadMaxSize = 20000000;
        
            /* cookbooks */
            include_once("$FarmD/cookbook/AdvancedTableDirectives.php");
            include_once("$FarmD/cookbook/attachdel.php");
            include_once("$FarmD/cookbook/extendcond.php");
            include_once("$FarmD/cookbook/editformcustomfields.php");
            include_once("$FarmD/cookbook/expirediff.php");
            include_once("$FarmD/cookbook/httpvariables.php");
            include_once("$FarmD/cookbook/markupexprplus.php");
            include_once("$FarmD/cookbook/counter.php");
            include_once("$FarmD/cookbook/templates.php");
            include_once("$FarmD/cookbook/zap.php");
            include_once("$FarmD/cookbook/zaptoolbox.php");
        
            // configure the attachtable cookbook                                                                              
            switch($action) {
              case 'delattach':
              case 'renameattach':
              case 'downloaddeleted':
        	include_once("$FarmD/cookbook/attachtable/attachtable-actions.php");
        	break;
              case 'fileinfo':
              case 'thumbnail':
        	include_once("$FarmD/cookbook/attachtable/fileinfo.php");
        	break;
              case 'upload':
              default:
        	include_once("$FarmD/cookbook/attachtable/attachtable.php");
        	break;
            }
        
        ?>
        
        
        Again, don't forget the trailing newline
      4. Update the cookbook directory. The easiest way is to copy from the old directory to the new:
        cd ~www/php/pmwiki-2.2.56/cookbook
        (cd ../../pmwiki/cookbook; tar -cf - . ) | tar -xpf -
        
        As of 10/12, the following cookbooks were in use. Zap is used by the TerraSwarm quarterly reports.
        AdvancedTableDirectives.php  editformcustomfields.php  httpvariables.php   sourceblock.php
        attachdel.php                expirediff.php            markupexprplus.php  templates.php
        attachtable                  extendcond.php            mkexpext.php        zap.php
        counter.php                  geshi                     pagetoc.php         zaptoolbox.php
        
        See pmwiki/cookbooks.txt for a description of cookbooks that are installed.

        Below are instructions for installing various cookbooks by hand
        SourceBlock http://www.pmwiki.org/wiki/Cookbook/SourceBlock:

        cd ~www/php/pmwiki/cookbook
        wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/sourceblock.php
        
        Get the TableOfContents cookbook:
        cd ~www/php/pmwiki/cookbook
        wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/pagetoc.php
        
        Download and unpack the GeSHI (Generic Syntax Highlighter) from: Note that in 1/2012, the sourceforge GeSHI project page for the most recent file lead to an old version. Be sure to look in the Files page for the most recent version
        cd pmwiki/cookbook wget 'http://downloads.sourceforge.net/project/geshi/geshi/GeSHi%201.0.8.11/GeSHi-1.0.8.11.tar.bz2?r=http%3A%2F2Fsourceforge.net%2Fprojects%2Fgeshi%2F&ts=1353975857&use_mirror=iweb'
        tar -jxf GeSHi-1.0.8.11.tar.bz2
        
      5. Optional: Copy over jsMath.php from the old cookbook directory. We don't support jsMath because it is too damn big
      6. Install attachtable into pub/.
        cd pmwiki-2.2.56/pub
        (cd ../../pmwiki/pub; tar -cf - attachtable) | tar -xpf -
        
      7. Edit pmwiki/scripts/upload.php and change the UploadMaxSize to match the value of upload_max_filesize in /etc/php.ini (Linux) or /usr/local/lib/php.ini (Solaris):
        SDV($UploadMaxSize,20000000);
        Note: this step shouldn't be necessary, as the value is set in pmwiki/local/farmconfig.php
      8. We prefer to have the author name hardwired into the edit field. Update
        pmwiki/wikilib.d/Site.EditForm
        and change:
        $[Author]: (:input e_author:) 
        
        to
        $[Author]: {$Author}
        
      9. The siteConfig array was not available so we need to edit pmwiki.php. The problem here is that GLOBALS["trustSessionKey"] was not set, which meant that session[] is not available.

        if pmwiki.php contains

        if (ini_get('register_globals')) 
          foreach($_REQUEST as $k=>$v) { unset(${$k}); }
        
        The solution is to comment out these lines.

        If pmwiki.php contains

        if (ini_get('register_globals')) 
          foreach($_REQUEST as $k=>$v) { 
           if (preg_match('/^(GLOBALS|_GET|_POST|_COOKIE|_FILES|_ENV|_REQUEST|_SESSION)$/i', $k)) exit();
           unset(${$k}); 
          }
        
        Then do
        if (ini_get('register_globals')) 
          foreach($_REQUEST as $k=>$v) { 
            if (preg_match('/^(GLOBALS|_GET|_POST|_COOKIE|_FILES|_ENV|_REQUEST|_SESSION)$/i', $k)) exit();
            if (preg_match('/^(_SESSION)$/i', $k))
              unset(${$k}); 
          }
        

        FIXME: we should not be using global variables here. See http://us2.php.net/register_globals

      10. If you have not yet done so, create the link
        rm pmwiki
        ln -s pmwiki-x.y.z pmwiki
        
        To check this, see http://chess.eecs.berkeley.edu/dgc3/wiki/Dgc3/ComputerConfigOrca2Prereq
        Note: why this paricular site? what if tester doesn't have access to it?
      11. Test the wikis for each website. The easiest way to find the wikis is to do:
        ls -d ~www/cvswww/website/*/wiki
        

        Note: there are an awful of a lot of sites to check manually! and the tester may not have access to all of them. should this testing by automated? or can it be skipped?
      12. Check for security issues with http://www.pmwiki.org/wiki/PmWiki/SiteAnalyzer

      Getting Started

      1. Download from http://www.pmwiki.org to ~www/php/website, for example ~www/php/trust.eecs.berkeley.edu.
      2. Create a link
        ln -s pmwiki-x.y.z pmwiki
        
      3. Edit the GSRC website config.php file, for example ~www/php/trustt.eecs.berkeley.edu/config.php:
        // Set to 1 to enable the Wiki facility
        $siteConfig['enableWiki'] = 1;
        
      4. Do a cvs update in ~www/php and get recent changes.
        ~www/php/bin/cvswiki
        Creates wiki directory and prompts admin to update rewrite.conf
        ~www/php/include/group.inc.php
        Added support for hasWiki field in groups db.
        If you are adding wiki support to a preexisting website, you will need to add a hasWiki field to the groups field in the auth_N table. To do this, the phpMyAdmin interface, for example http://trust.eecs.berkeley.edu/mysql. Browse to the auth_N table and then to the groups field. Then select add and add the field with these parameters: TINYINT (1) DEFAULT '0' not null
        ~www/php/subpages/admin.config.php
        Added support to allow group admin to request a wiki
        ~www/php/wiki.php
        Wiki configurations common to all wiki sites on Chess, Trust etc.
        If you are adding a new website, be sure to create /images/logo-100.gif in the corresponding website cvs repository, for example: trustwww/images/logo-100.gif. The wiki.php file uses logo-100.gif in the title bar.
      5. Create ~www/php/trust.eecs.berkeley.edu/pmwiki/local/config.php:
        <?php if (!defined('PmWiki')) exit();
        include_once("wiki.php");
        ?>
        
        This will load php/wiki.php
        Before we started using php/wiki.php, we used php/website/wikiconfig.php. If you are using wikiconfig.php, use this:
        <?php if (!defined('PmWiki')) exit();
        $SERVER_NAME     = $_SERVER['SERVER_NAME'];
        include_once("$SERVER_NAME/wikiconfig.php");
        ?>
        
        This will load the website specific wikiconfig.php, which is kept separate from pmwiki so that we can easily use version control.
      6. We use Wiki farms to manage the separate wiki pages for workgroups
        Create ~www/php/trust.eecs.berkeley.edu/pmwiki/local/farmconfig.php:
        <?php if (!defined('PmWiki')) exit();
            include_once('include/util.inc.php');
            #log_event("farmconfig.php: FarmD: $FarmD");
            # Settings performed before field-customizations
            $SERVER_NAME     = $_SERVER['SERVER_NAME'];
            #$ScriptUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pmwiki.php";
            #$ScriptUrl = "http://$SERVER_NAME/wiki";
            $FarmPubDirUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pub";
        
            # load the field's global and per-group customizations
            #include_once("$SERVER_NAME/pmwiki/local/config.php");
            include_once('local/pgcust.php');
            $EnableLocalConfig = 1;
            include_once('local/pgcust.php');
            # Make sure the user can read the wiki. See php/wiki.php
            wiki_access_auth();
            # Override field customizations here
            $EnableUpload = 0;            # disable uploads
        ?>
        
      7. Set up a skin
        cd /home/www/php/trustt.eecs.berkeley.edu/pmwiki/pub/skins
        wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/simple.tgz
        tar -zxf simple.tgz
        
        wikiconfig.php already includes the skin, so you need not edit wikiconfig.php
      8. The siteConfig array was not available so we need to edit pmwiki.php. The problem here is that GLOBALS["trustSessionKey"] was not set, which meant that session[] is not available.

        if pmwiki.php contains

        if (ini_get('register_globals')) 
          foreach($_REQUEST as $k=>$v) { unset(${$k}); }
        
        The solution is to comment out these lines.

        If pmwiki.php contains

        if (ini_get('register_globals')) 
          foreach($_REQUEST as $k=>$v) { 
           if (preg_match('/^(GLOBALS|_GET|_POST|_COOKIE|_FILES|_ENV|_REQUEST|_SESSION)$/i', $k)) exit();
           unset(${$k}); 
          }
        
        Then do
        if (ini_get('register_globals')) 
          foreach($_REQUEST as $k=>$v) { 
            if (preg_match('/^(GLOBALS|_GET|_POST|_COOKIE|_FILES|_ENV|_REQUEST|_SESSION)$/i', $k)) exit();
            if (preg_match('/^(_SESSION)$/i', $k))
              unset(${$k}); 
          }
        

        FIXME: we should not be using global variables here. See http://us2.php.net/register_globals

      9. We prefer to have the author name hardwired into the edit field. Update
        /pmwiki/wikilib.d/Site.EditForm
        and change:
        $[Author]: (:input e_author:) 
        
        to
        $[Author]: {$Author}
        
      10. Become the admin for the first workgroup that is to have a wiki, go to the admin page and request a wiki. You will be prompted to edit /usr/local/apache/conf/rewrite.conf and, as root, restart httpd:
        /etc/init.d/apachectl graceful
        
      11. Go to the page for the new wiki.
      12. Create a subdirectory with the name as the group. The reason is because we want to possibly be able to use the wiki as a top level. So, for the group scada, go to http://trust.eecs.berkeley.edu/scada/wiki" and edit the page, creating a link to Scada/Main:
        [[Scada/Main | Main Scada Page]]
        
        Then save the edit and click on the "Main Scada Page" link to bring up http://trust.eecs.berkeley.edu/scada/wiki/Scada/Main"

      Using JS

      JsMath is a cookbook that will display LaTeX.
      1. http://www.pmwiki.org/wiki/Cookbook/JsMath contains jsMath.php which gets copied to ~www/php/pmwiki/cookbook
      2. Edit ~www/php/wiki.php and add
        # JsMath "Add markup to display and embed mathematical formulas in wiki pages using TeX.: http://www.pmwiki.org/wiki/Cookbook/JsMath
        include_once('pmwiki/cookbook/jsMath.php');
        
      3. Download JsMath from http://www.math.union.edu/locate/jsMath
      4. Follow the "Download JsMath for Authors instructions" and download "jsMath" and "jsMath Image Fonts".
      5. See the top of the jsMath.php file. Go to ~www/php/pmwiki and uncompress the two files. This will create ~www/php/pmwiki/jsMath.
      6. You are done! See http://chess.eecs.berkeley.edu/dgc3/wiki/Dgc3/ChristopherBrooks for an example.

      Getting Started

      Below are my notes on how I installed wiki the first time. If you are installing for a GSRC website, see above.
      1. Download from http://www.pmwiki.org to ~www/php/website, for example ~www/php/trust.eecs.berkeley.edu.
      2. Create a link
        ln -s pmwiki-x.y.z pmwiki
        
      3. As root, modify /usr/local/apache/conf/rewrite.conf to remap wiki/ to pmwiki.php
        RewriteRule ^/wiki$ /wiki/ [R,L]
        RewriteRule ^/wiki/([^/]*)/?(.*)$ /home/www/php/%{HTTP_HOST}/pmwiki/pmwiki.php?%{QUERY_STRING} [L]
        
        
        Then, as root, restart httpd:
        /etc/init.d/apachectl graceful
        
      4. Set up the wiki directory. Note that this is temporary, we will set up per website and per workgroup wikis shortly
        mkdir /home/www/php/trust.eecs.berkeley.edu/pmwiki/wiki.d
        chown apache /home/www/php/trust.eecs.berkeley.edu/pmwiki/wiki.d
        
      5. Go to the wiki! http://trustt.eecs.berkeley.edu/wiki

      Configuring pmwiki

      We need to set passwords etc, see Further Installation Instructions
      1. Set up the sample file
        cd /home/www/php/trust.eecs.berkeley.edu/pmwiki
        cp sample-config.php local/config.php
        
        Make these edits to config.php
        $WikiTitle = 'Team for Research in Ubiquitous Secure Technology';
        $PageLogoUrl = "/images/trust-100.gif";
        $DefaultPasswords['admin'] = crypt('a password');
        $DefaultPasswords['upload'] = crypt('a password');
        $SERVER_NAME     = $_SERVER['SERVER_NAME'];
        $ScriptUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pmwiki.php";
        $PubDirUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pub";
        
        
      2. Set up a skin
        cd /home/www/php/trustt.eecs.berkeley.edu/pmwiki/pub/skis
        wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/simple.tgz
        tar -zxf simple.tgz
        
        Make these edits to config.php
        $Skin = 'simple';
        $SkinCopyright = "Copyright © 2006 The Regents of the University of California";
        
      3. Setting up a Wiki Farm
        See http://www.pmichaud.com/wiki/PmWiki/WikiFarms
        1. php/subpages/admin.config.php and the database have been extended to include a hasWiki field. ~/php/bin/cvswiki is a script that adds a wiki directory to the cvs repository for a workgroup. Note that using a wiki on the database requires cvs authoring which in turn requires a cvs module for this workgroup. The reason is that we want to allow farm administrators to be able to configure their farm. Hopefully the workgroup config page will do the right thing if "Wiki" is selected: request a cvs repository if necessary and set up cvs authoring for the home page.
        2. The page ~/php/trustt.eecs.berkeley.edu/pmwiki/local/farmconfig.php Controls the look and feel for all the farms. farmconfig.php looks like:
          <?php if (!defined('PmWiki')) exit();
              # Settings performed before field-customizations
              $SERVER_NAME     = $_SERVER['SERVER_NAME'];
              #$ScriptUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pmwiki.php";
              $FarmPubDirUrl = "http://$SERVER_NAME/php/$SERVER_NAME/pmwiki/pub";
              # 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
          ?>
            
      4. As root, modify /usr/local/apache/conf/rewrite.conf to remap wiki/ to pmwiki.php
        RewriteRule ^/scada/wiki$ /scada/wiki/ [R,L]
        RewriteRule ^/scada/wiki/$ /home/www/cvswww/%{HTTP_HOST}/scada/wiki/field.php [L]
        RewriteRule ^/scada/wiki/index.php$ /home/www/cvswww/%{HTTP_HOST}/scada/wiki/field.php [L]
        RewriteRule ^/scada/wiki/([^/a-z].*) /home/www/cvswww/%{HTTP_HOST}/scada/wiki/field.php?n=$1 [QSA,L]
        
        
        Then, as root, restart httpd:
        /etc/init.d/apachectl graceful
        

      Problems

      The siteConfig array was not available

      The problem here is that GLOBALS["trustSessionKey"] was not set, which meant that session[] is not available.

      pmwiki.php contains

      if (ini_get('register_globals')) 
        foreach($_REQUEST as $k=>$v) { unset(${$k}); }
      
      The solution is to comment out these lines.

      FIXME: we should not be using global variables here. See http://us2.php.net/register_globals

      Cleaning URLS

      http://www.pmwiki.org/wiki/Cookbook/CleanUrls

      Set up per group directories

      http://www.pmichaud.com/wiki/Cookbook/PerGroupSubDirectories says to put the following in config.php
      $WikiDir = new PageStore('wiki.d/$Group/$FullName');
      
      Note that for each group, you will need to do
      mkdir ~www/php/trust.eecs.berkeley.edu/pmwiki/wiki.d/Foo
      chown apache ~www/php/trust.eecs.berkeley.edu/pmwiki/wiki.d/Foo
      
      The group names need to be capitalized.

      Setting the group name

      To set the website group name, wiki/local/pgcust.php sets $WikiGroup. Note that phpcust.php is created by php/bin/cvsauthoring.

      Setting the author name

      See http://www.pmwiki.org/wiki/Cookbook/RequireAuthor
      Basically, wikiconfig.php includes
      include_once("$SERVER_NAME/pmwiki/scripts/authuser.php");
      $Author = $AuthId;
      

      Controlling read access to wiki pages

      wiki.php defines a wiki_access_auth() function that checks the access array. This function is called from $SERVER/pmwiki/local/farmconfig.php after group/local/pgcust.php is called and the $WikiGroup is set.

      Having the upload link in the monospace skin

      This one was fun!
      The monospace skin has tabs at the top. The tabs are defined in Find alternate file: /home/www/php/chess.eecs.berkeley.edu/pmwiki-2.1.5/wikilib.d/Site.PageActions . That file looks has a section:
      (:if auth upload:) 
      
      and then creates the upload link.

      pmwiki.php includes

      $Conditions['auth'] =
        'NoCache(@$GLOBALS["PCache"][$GLOBALS["pagename"]]["=auth"][trim($condparm)])';
      
      what this does is look for an array that has [=auth][auth] set to 1.

      The way we set this value is in wiki.php we now explicitly set that value when we check for edit access.

      Fixing codeboxes in the monospace skin

      Another useful Cookbook item for PmWiki is the Sourceblock recipe. Sourceblock and Monobook are both products by the same developer in PmWiki, dfaure. The stylesheets which afford a separation of code blocks were not working with the monobook skin, so there was this advice:
      Dominique Faure wrote:
      
      Some urls in the page dumps you provided suggest that 
      you where using pmwiki v2.1.5 and a not-as-old monobook
      skin. Sadly, the monobook skin version is more up-to-date
      than the wiki engine itself.
      You may then either:
      * upgrade your pmwiki version to v2.1.27 (latest stable,
        my prefered choice here),
      * or downgrade your monobook skin local copy, by locating
        and modifying the monobook.tmpl text file: search the
        string "<!--HTMLHeader--<" and replacing it with 
        "<!--HeaderText-->".
      
      I chose to edit the monobook skin locally, on andrews, in the chess php directory. FIXME: When upgrading PmWiki, the monobook skin should also be upgraded. [Notes by Jonathan Sprinkle.]

      Problems with uploads

      If you click on an upload and get the group page, then check that Home Page and CVS checkin are enabled.

      User level notes about configuring the wiki: "How do I configure the wiki?"

      Adjusting the upload size

      To adjust the upload size, edit php/wiki.php

      Search not working

      docs/sample-config.php contains text that gets added to local/config.php.
      ## By default, viewers are prevented from seeing the existence  
      ## of read-protected pages in search results and page listings, 
      ## but this can be slow as PmWiki has to check the permissions 
      ## of each page.  Setting $EnablePageListProtect to zero will  
      ## speed things up considerably, but it will also mean that 
      ## viewers may learn of the existence of read-protected pages. 
      ## (It does not enable them to access the contents of the pages.)
      $EnablePageListProtect = 0;