oracledba.help

PMWiki 101

<- SpecialTopics

Overview

PmWiki is a wiki-based content management system (CMS) for collaborative creation and maintenance of websites. PmWiki is superb for documentation.

TOC

Install Apache & PHP on Linux

 1. yum install httpd -y
    systemctl start httpd.service
    systemctl enable httpd.service
    Test http://localhost
 2. yum install php -y
    systemctl restart httpd.service
    systemctl enable php.service 🠈 Newer versions may not require this.
 3. Create Test File
    vi /var/www/html/pi.php 
    <?php phpinfo(); ?>
 4. Test
    http://myhostname/pi.php

PHP 7 QuickStart here.

Security Changes

 1. Disable SELINUX if used.
    Otherwise you may get messages like this: PmWiki "Cannot acquire lockfile"
 2. Set owner and privs.
    chown -R apache:apache /var/www/html
    chmod -R 757 /var/www/html

Install PMWiki

Download software from here.

Copy to Web Server Path

If on Client PC

 • unzip pmwiki-latest.zip to D:\sw\PMWiki\pmwiki-latest\pmwiki-n.n.nn
 • Use FileZilla to copy ...\pmwiki-n.n.nn\* to Linux systems /var/www/html/

If on Linux Host System

 • cp pmwiki-latest.zip /var/www/html/
 • cd /var/www/html
 • unzip pmwiki-latest.zip
   /var/www/html/pmwiki-2.2.nnn created.

Rename pmwiki-2.2.nnn to your Wiki dir name:

   mv /var/www/html/pmwiki-2.2.116  /var/www/html/MyWikiDir

Init Wiki

 • Navigate to: http://MySiteURL/MyWikiDir/pmwiki.php
   Wiki should be displayed.
 • Make any indicated changes then refresh page to confirm OK.
   Example changes:
   mkdir /var/www/html/MyWikiDir/wiki.d
   chmod 777 /var/www/html/MyWikiDir/wiki.d

Common Changes

config.php Changes

Copy Template File

 • cd /var/www/html/MyWikiDir/docs
 • cp sample-config.php /var/www/html/MyWikiDir/local/config.php

Copy Your Site Image File (if used)

 • Create Logo Image.
 • Copy Logo Image to /var/www/html/MyWikiDir/pub/skins/pmwiki
   This is the physical dir for image file (AKA PageLogoUrl).

Edit config.php
vi /var/www/html/MyWikiDir/local/config.php

 # Set Wiki Title
 $WikiTitle = 'MyTitle';

 # Set Path to Logo Image (if used)
 $PageLogoUrl = "$PubDirUrl/skins/pmwiki/MyLogo.png";

 # Set Links Default to Open in New Tab (add this to end of file)
 $UrlLinkFmt = "<a class='urllink' href='\$LinkUrl' rel='nofollow' target='_blank'>\$LinkText</a>";

 # Enable CSS line-height
 $WikiStyleCSS[] = 'line-height';

 # TimeZone (change if needed)
 putenv("TZ=EST5EDT"); # if you run PHP 5.0 or older
 date_default_timezone_set('America/New_York'); # if you run PHP 5.1 or newer

To disable link behavior for specific links use %target=_self% in front of the link.

Set Start Page (index.ext)

Ideally rename pmwiki.php to index.php or alternatively create redirect page for index.html.

<html>
<head>
<meta http-equiv="refresh" content="0;url=http://MySiteURL/MyWikiDir/pmwiki.php">
</head>
</html>

Google and many other search engines do not like redirect main pages. If your wiki is for local network use then redirecting index.html is OK.

Password Protect Site

Place at top of file: /var/www/html/MyWikiDir/local/config.php

# Custom Changes: Start ###############
$DefaultPasswords['read'] = pmcrypt('MySitePW');
# Custom Changes: End   ###############

Uncomment\Edit

$DefaultPasswords['admin'] = pmcrypt('MySitePW');
...
$DefaultPasswords['upload'] = pmcrypt('MySitePW');

Commonly Installed Cookbooks


APPENDIX

Google Search

(:table :)
(:cell:) 
(:input form action="http://www.google.com/search" method=get:)
(:input text name=q value="" size=9 :)(:input submit name Search:)
(:input hidden name="sitesearch" value="oracledba.help/":)
(:input end:)
(:tableend:)

Enable Uploads

  1. Create an uploads dir under wherever pmwiki.php found. Note lower case.
  2. Make required changes to config.php
# Uploads Cfg
$DefaultPasswords['upload'] = pmcrypt('MySitePW');
$EnableUpload = 1;
$UploadPermAdd = 0;
$UploadPrefixFmt = ''; #Cfg for site-wide uploads
$UploadMaxSize = 1000000; # Upload Max File Size: 1mb=1000000, 25mb=25000000 etc.

# To find path use PHP Variable (pi.php): _SERVER["APPL_PHYSICAL_PATH"]
# Ex: D:\home\oracledba.help\wwwroot\
# Then from that:
#$UploadDir = "D:\home\oracledba.help\wwwroot\app\mp3\uploads";
#$UploadUrlFmt = "http://oracledba.help/mp3/uploads";

Note: Ensure your PHP installation allows uploads. The php.ini file needs file_uploads = On.

Usage
Attach:FileName.jpg
Example: Attach:chuck.jpg

Show All Uploaded Files: (:attachlist:)


Clean Table Look

CaseCreatedTopic
237636507/06/17This is a test.
234413003/24/17This is another test.

Form Controls: ASCII and UNICODE Images

Complete chart here. ☑ ☐ ⮽ ★☆☀ 🖸 ⮾ ⮿ 🢧🢠 🠈🠊 🡆🡄 ✓✔

Form Controls: HTML

   Abcd...
   Zyxw...
  Year: 


Standard Callouts

 %target=_blank%
 %bgcolor=yellow%

 >>note      fullwidth border='1px solid DarkGray' font-size=small<<
 >>important fullwidth border='1px solid DarkGray' font-size=small<<
 >>warning   fullwidth border='1px solid DarkGray' font-size=small<<

 <warning|important|tip> border='1px solid gray'

Custom Changes: <Hn> Values

Custom HTML <Hn> changes from the base install.

  • Get a color swatch for site.
    Ex: https://coolors.co
  • Edit /var/www/html/oradocs/pub/skins/pmwiki/pmwiki.css as shown:
#h1, h2, h3, h6 { font-weight:normal; }

h1 { font-size:2em;    font-weight:bold; color:#0d0221;}
h2 { font-size:1.5em;  font-weight:bold; color:#0f084b;}
h3 { font-size:1.15em; font-weight:bold; color:#26408B;}
h4 { font-size:.85em;  font-weight:bold; color:#a6cfd5;}
Set the color: values to match your swatch.
  • Edit /var/www/html/oradocs/pub/skins/pmwiki/pmwiki.tmpl
Change this line:
<h1 class='pagetitle'>{$Title}</h1></div>

to this:
<h1>{$Title}</h1></div>
This ensures page title uses your <Hn> swatch value.

Enabling Javascript

(:html:)
   <script language="JavaScript">
       alert("Thanks to PM for that markup.");
   </script>
(:htmlend:)

Page Variables

Define
 (:vPatchNumber: 29252164:)
Usage: 
 {$:vPatchNumber}

Smaller Text Block

>>frame background-color=#eeeeee border='1px' font-size=smaller padding=0px width=500<<

Ei labore minimum quaestio quo. Ut vel docendi tibique, vix in quem meis
menandri, no eam labore invenire patrioque. Eu eum consul suscipiantur, 
mel ea soluta libris. Tollit laudem vim no. Aliquid intellegam voluptatibus
ad cum, lorem populo iracundia ut mei. Salutandi facilisis necessitatibus
in quo, aeque gloriatur eum an, laboramus voluptaria eu sea.

WikiStylesPlus Install Session

cd /u01/orasw/pmwiki/wsplus

cp wsplus.zip /var/www/html/MyWikiDir/

cd /var/www/html/MyWikiDir

unzip wsplus.zip
Archive:  wsplus.zip
  inflating: cookbook/wsplus.php
   creating: pub/wsplus/
  inflating: pub/wsplus/tip.gif
 extracting: pub/wsplus/warning.gif
  inflating: pub/wsplus/csshover.htc
  inflating: pub/wsplus/wsplus.css
 extracting: pub/wsplus/important.gif


vi /var/www/html/MyWikiDir/local/config.php
include_once('cookbook/wsplus.php');