Wiki Server

Meaning “quick” in the Hawaiian language, wiki is a creative and open environment where everyone can create or edit a page right on the fly and very easily. Wiki page can be used as white board where everyone can collaborate, attach files, link to other pages, etc.

Wiki allows to collecting all the pieces of knowledge, in any topic or project. The wiki becomes a repository of knowledge and documentation that everyone can contribute to, search and learn from. The more knowledgeable everyone are, the better everyone can improve and perform their tasks.

Besides the usual collaborative features such as content management and knowledge base, wikis has been used by companies or groups as an internal communication platform with task management and meeting archives. It is also used by university and research teams.

To know more about wiki system read PmWiki software page.



Install

Install PHP and check ini configurations for development mode, read pmwiki software page for various sources to download from, this wiki is maintained by git at wiki.git. Clone or extract pmwiki.

Read PmWiki Installation and maintenance documentation.


Cookbooks

Pmwiki hosted by tribu provides the following cookbooks;

Langviews
show language specific content and titles according to user choice.
CMSMode
wiki look and act like a normal website for non-author visitors.
PccfToPcfOverride
Allows existing recipes to run on PHP 7 without causing deprecated create_function() messages.
Captcha
Captcha system (used on comments for B3).
B3
Blog / News system with comments and captcha support.

Configure

Copy local/default-config.php (or upstream doc/sample-config.php) to local/config.php. To enable rewrite pmwiki/local/config.php, this will work only under nginx or apache.

$ScriptUrl = 'https://wiki.leetio.dev';
$EnablePathInfo = 1;

PccfToPcfOverride

Fix PHP 7+ without getting "create_function() is deprecated" warnings.

# PccfToPcfOverride configuration;
#
# $EnablePCF = 1 Circumvent calls to create_function()
# by PCCF, PPRE and Markup_e
$EnablePCF     = 1;

# Display a summary of the calls
# to PCCF, PPRE and Markup_e
# $EnablePCFWarn = 1 enable warning
$EnablePCFWarn = 0;

# Causes PCFWarn to drop the path thru your-document-root
# to shorten displayed file names
$PCFRootPat    = '%^.*?/ROOT_PATH_TO_WIKI/(.*)%';
include_once ("$FarmD/cookbook/pccf2pcf.php");

Langviews

Lang views configuration;

# Langviews configuration;
#
# $MLVList default array for language id's and labels:
$MLVList = array(
        'en' => 'English',
        'pt' => 'Deutsch',
        'fr' => 'Francais',
        'it' => 'Italiano',
        'es' => 'Espanol',
        'pt' => 'Portuguese',
        'vi' => 'Vietnamese',
 );

#default language id.
#Set to different default in config.php before
#including langviews.php.
$MLVDefault='en';

#default link type for (:selectlang:) markup,
#set in config.php to different link type before
#including langviews.php ('label' or 'flag').
$MLVSelectDefault= 'label';

#$MLVLinkPatterns default array, for defining (:selectlang:) link formats. Note that '$page', '$id' and '$label' are used as pseudo-variables:
SDVA($MLVLinkPatterns, array(
   // links with id label
   'id'    => '[[$page?setlang=$id|$id]]',
   // links with text label
   'label' => '[[$page?setlang=$id|$label]]',
   // links with images (flags) plus tooltip label
   'flag'  => '[[$page?setlang=$id|Attach:Site/Site/$id.png"$label"]]',
));
## Unicode (UTF-8) allows the display of all languages and all alphabets.
include_once("$FarmD/cookbook/langviews.php");
include_once("scripts/xlpage-utf-8.php");

CMSmod configuration;

# CMS Mode
#
# Settings for CMS Mode
$pagename = ResolvePageName($pagename);
## Add some off-limits groups.
#SDVA($CMSRedirGroups,array(
#  'Tribu', 'Profiles', 'Project'));
#SDVA($CMSRedirGroups,array('Profiles'));

## These will be omitted from search results.
SDVA($CMSExclSearchGroups,array(
  'Profiles', 'Tribu', 'Project'));
## Changes made to these will be ommitted from the RSS feed.
SDVA($CMSExclARCGroups,array(
  'Profiles', 'Tribu', 'Project', 'Category'));
## Allow ?action=myrecipeaction
#$CMSAllowedActions[] = 'myrecipeaction';
$CMSAllowedActions[] = 'b3rss';
## Disallow ?action=print
#$CMSAllowedActions['print'] = '';
#$CMSAllowedActions['attr'] = '';
##  Enable the CMS Mode recipe.
$pagename = ResolvePageName($pagename);
## Highly recommended for new wikis.
include_once("$FarmD/cookbook/cmsmode.php");

B3 configuration

# The browser-accessible URL to the pub/b3 directory with styles and helper
# scripts. If you have a wikifarm on multiple (sub)domains, you may need to copy
# the b3 directory into the "pub" directory of individual fields and set here
# '$PubDirUrl/b3'.
$B3['DirUrl'] = '$FarmPubDirUrl/b3';

# The time format for the dates stored in the pages. The format needs
# to be parsable by strtotime().
$B3['TimeFmt'] = '%Y-%m-%d %H:%M %z';

# Default comments settings when pre-filling the edit template, or when the
# individual post page doesn't have a known Comments: attribute.  Can be Open,
# Closed, Disabled and Moderated, see above.
$B3['EnableComments'] = 'Open';

# The default date stamp pre-filled in the "Add post" form.
$B3['NewPostDefaultDate'] = 'Now + 60min';

# The default text pre-filled when a new post is created. If the text starts
# with 'page:', like 'page:News.Template#template#templateend lines=2..' then
# that page or section will be used as a template (specifications same as for
# the include directive).
$B3['DefaultText'] = 'Describe {title} here.';

# To enable Captcha for comments, or not. Set this to false to not require
# Captcha verification for comments. Note that the Captcha is only shown to
# people without 'edit' permissions for the current blog entry. Note that for
# Captcha to be enabled, you need to place the captcha.php file in your cookbook
# directory.
$B3['EnableCaptcha'] = true;

# How many blog posts are to be displayed per listing page. If there are more          
# pages, a list trail to previous and next pages will be shown at the bottom of        
# the listing. 
$B3['PerPage'] = 10;
# Whether a trail to older and newer articles should be enabled on blog posts
# (all categories). Set to false to disable.
$B3['EnablePageTrail'] = true;
$EnableCaptchaImage=1;
#$CaptchaImageCSS=1;
$EnableCaptchaImageDataURI=1;
include_once("$FarmD/cookbook/captcha.php");
include_once("$FarmD/cookbook/b3.php");

Develop

Read about PHP language, vim editor, PHP development and git branch model.

$ git checkout -b develop
$ php -S localhost:8000

Visit wiki at http://localhost:8000/pmwiki.php.

Development documentation;


Nginx

Read nginx documentation, configure server and server with php.

Dedicated server;

Configure nginx server /etc/nginx/sites-enabled/wiki.example.com.conf

server {
    server_name wiki.example.com;
    root /srv/www/pmwiki/pub;

    index pmwiki.php;

    location ~ ^/(cookbook|local|scripts|wiki.d|wikilib.d) {
        deny all;
    }

    location / {
        try_files $uri $uri/ @pmwiki;
    }

    location @pmwiki {
        rewrite ^/(.*) /pmwiki.php?n=$1;
    }

    ## php configuration using unix sockets.
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
    }

    # cache configuration for most common files
    location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
        # Some basic cache-control for static files to be sent to the browser
        expires max;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

    # drop common log errors
    location = /robots.txt { access_log off; log_not_found off; }
    location = /favicon.ico { access_log off; log_not_found off; }
    location ~ /\. { access_log off; log_not_found off; deny all; }
    location ~ ~$ { access_log off; log_not_found off; deny all; }
}

Directory

location /pub {
        alias /srv/www/pmwiki/pub;
}

location /wiki {
         alias /srv/www/pmwiki/;
         index pmwiki.php;
         try_files $uri $uri/ @pmwiki;
}

location @pmwiki {
         rewrite ^/wiki/(.*) /wiki/pmwiki.php?n=$1;
}

location ~  ^/wiki(.+\.php)$ {
    alias /srv/www/pmwiki;
    index pmwiki.php;

}