An experience with MonkeyWiki

Monkey Wiki is running on a Linux Debian server.

Servers

I have two servers : one with Debian the other with Ubuntu. So what I describe is linux driven, especially Debian (for instance Apache settings).
I organize the wiki life :

Note that the cgi-bin directory is in /var/www (this is not Ubuntu's way).

Code and cgi-bin

Python site-package

  1. Once uploaded from Monkey Wiki site monkeywiki.py has been dropped into the directory /usr/lib/python2.4/site-packages/

cgi-bin directory

  1. Barnaby explain me that a "wrapper" can call Monkey Wiki from the cgi-bin directory,
    • so I place the wrapper (My wrapper code below) in /var/www/cgi-bin. This will be the main wiki for the team (here qmwiki.cgi)
    • as I also use other subdirectories in this cgi-bin directory, for example /var/www/cgi-bin/dynw, in theses subdirectories I have python cgi programs developped by the team, I place a wrapper within the subdirectory to become a project wiki
    • I create a /var/www/cgi-bin/adminwiki with a .password .htaccess protection (Apache) where I put a copy of the same wrappers.

So each wiki may be

  1. read from all the web
  2. read (and modified) for administrators (the project team)

Local change of the code

I customize the Monkey Wiki code to get a on-site backup.
See the changes : Monkey Wiki Customization

Directories

For each wiki, in /var/www I place a directory (say mw_wiki) and inside this
I create all the subdirectories I need, one for each wiki.
/var/www/monkey_wiki/qmwiki
/var/www/monkey_wiki/dynw etc.
Then I create subdirectories in each:

These two directory are not in a basic mw installation and the last one is used in parallel with the "information-backup" system of Monkey Wiki.
/var/www/monkey_wiki/qmwiki/text is thus the place to hold all the pages for qmwiki.
The basic Style File is from Barnaby's site (I copy the css file) with a few modifications and Template File is mine.

Wrappers

I need two wrappers, because only team member can modify the wiki, visitors beeing admitted to only read.
The basic wrapper is designed to enable reading so EDITABLE is set to 0
The admin wrapper has EDITABLE=1 to enable writing, renaming and deleting.

Basic wrapper

#!/usr/bin/python
import cgi #the wrapper is a small cgi program
import monkeywiki as mw #it is calling monkeywiki
mw.PATH_TO_WIKI_TEXT = '/var/www/monkey_wiki/mq_wiki/text/' 
mw.PATH_TO_TEMPLATES = '/var/www/monkey_wiki/mq_wiki/templates/'
mw.EDITABLE = 0 #read only
mw.BACKUP_DIR = 'no_dir_needed' #if read only no modification and no backup
mw.main()


---
This wrapper is in the cgi directory

Admin wrapper

#!/usr/bin/python
import cgi #the wrapper is a small cgi program
import monkeywiki as mw #it is calling monkeywiki
mw.PATH_TO_WIKI_TEXT = '/var/www/monkey_wiki/mq_wiki/text/' #same site as before
mw.PATH_TO_TEMPLATES = 'nothing' #no template for administrator, a plain white page without css !
mw.EDITABLE = 1 #the team members will have writing access
mw.BACKUP_DIR = '/var/www/monkey_wiki/mq_wiki/backup/' #and therefore backup is needed
mw.main()


This version is in a /var/www/cgi-bin/adminwiki directory with .htaccess and .htpasswd protection

Settings for apache

Of course you need to configure apache (or another web server, but why not apache ?)
In Apache Settings you will find the lines I use.
You need also to create the .htaccess and .htpasswd files inside the protected directory.

Sun Aug 17 11:33:56 2008

Valid CSS! PRABI image Valid CSS! [Python Powered]