A workgroup may have a wiki associated with it.
For example, see
http://chess.eecs.berkeley.edu/ptexternal/wiki
User level website wiki instructions
sudo -i su - mastwiki cd /projects/sastry/www-pages/home/mastThen see the
README.txt
file.
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
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";
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
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.phpSee
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.phpGet the TableOfContents cookbook:
cd ~www/php/pmwiki/cookbook wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/pagetoc.phpDownload and unpack the GeSHI (Generic Syntax Highlighter) from:
http://qbnz.com/highlighter/
- did not work in Dec., 2010.http://sourceforge.net/projects/geshi/
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
jsMath.php
from the old cookbook directory. We don't support jsMath because it is too damn big
pub/
.
cd pmwiki-2.2.56/pub (cd ../../pmwiki/pub; tar -cf - attachtable) | tar -xpf -
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
pmwiki/wikilib.d/Site.EditFormand change:
$[Author]: (:input e_author:)to
$[Author]: {$Author}
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
rm pmwiki ln -s pmwiki-x.y.z pmwikiTo check this, see
http://chess.eecs.berkeley.edu/dgc3/wiki/Dgc3/ComputerConfigOrca2Prereq
ls -d ~www/cvswww/website/*/wiki
http://www.pmwiki.org
to ~www/php/website
, for example
~www/php/trust.eecs.berkeley.edu
.
ln -s pmwiki-x.y.z pmwiki
~www/php/trustt.eecs.berkeley.edu/config.php
:
// Set to 1 to enable the Wiki facility $siteConfig['enableWiki'] = 1;
~www/php
and get recent
changes.
~www/php/bin/cvswiki
rewrite.conf
~www/php/include/group.inc.php
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
~www/php/wiki.php
/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.
~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
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.
~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 ?>
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
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
/pmwiki/wikilib.d/Site.EditFormand change:
$[Author]: (:input e_author:)to
$[Author]: {$Author}
/usr/local/apache/conf/rewrite.conf
and, as root, restart httpd:
/etc/init.d/apachectl graceful
[[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"
jsMath.php
which gets copied to ~www/php/pmwiki/cookbook
~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');
http://www.math.union.edu/locate/jsMath
jsMath.php
file.
Go to ~www/php/pmwiki
and
uncompress the two files. This will create
~www/php/pmwiki/jsMath
.
http://chess.eecs.berkeley.edu/dgc3/wiki/Dgc3/ChristopherBrooks
for an example.
http://www.pmwiki.org
to ~www/php/website
, for example
~www/php/trust.eecs.berkeley.edu
.
ln -s pmwiki-x.y.z pmwiki
/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
mkdir /home/www/php/trust.eecs.berkeley.edu/pmwiki/wiki.d chown apache /home/www/php/trust.eecs.berkeley.edu/pmwiki/wiki.d
http://trustt.eecs.berkeley.edu/wiki
cd /home/www/php/trust.eecs.berkeley.edu/pmwiki cp sample-config.php local/config.phpMake 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";
cd /home/www/php/trustt.eecs.berkeley.edu/pmwiki/pub/skis wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/simple.tgz tar -zxf simple.tgzMake these edits to
config.php
$Skin = 'simple'; $SkinCopyright = "Copyright © 2006 The Regents of the University of California";
http://www.pmichaud.com/wiki/PmWiki/WikiFarms
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.
~/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 ?>
/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
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
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/FooThe group names need to be capitalized.
$WikiGroup
. Note that phpcust.php is created
by php/bin/cvsauthoring
.
http://www.pmwiki.org/wiki/Cookbook/RequireAuthor
wikiconfig.php
includes
include_once("$SERVER_NAME/pmwiki/scripts/authuser.php"); $Author = $AuthId;
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.
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.
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.]
Home Page
and CVS checkin
are enabled.
User level notes about configuring the wiki: "How do I configure the wiki?"
php/wiki.php
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;