Apache::MiniWiki - Miniature Wiki for Apache
Apache::MiniWiki is an simplistic Wiki for Apache. It doesn't have much uses besides very simple installations where hardly any features are needed. What is does support though is:
- storage of Wiki pages in RCS - templates through HTML::Template - text to HTML conversion with HTML::FromText - basic authentification password changes - ability to view any revision of a page - ability to revert back to any revision of the page - basic checks to keep search engine spiders from deleting all the pages in the Wiki!!!
This module requires these other modules:
Apache::Htpasswd Apache::Constants CGI HTML::FromText HTML::Template Rcs
Add this to httpd.conf:
<Location /wiki> PerlAddVar datadir "/home/foo/db/wiki/" PerlAddVar vroot "/wiki" SetHandler perl-script PerlHandler Apache::MiniWiki </Location>
Require a password to read/write any page: <Location /wiki> PerlAddVar datadir "/home/foo/db/wiki/" PerlAddVar vroot "/wiki" PerlAddVar authen "/home/foo/db/htpasswd" SetHandler perl-script PerlHandler Apache::MiniWiki AuthType Basic AuthName "Sample Wiki" AuthUserFile /home/foo/db/htpasswd Require valid-user </Location> Public can read, but need password to edit/save/revert a page: <Location /wiki> PerlAddVar datadir "/home/foo/db/wiki/" PerlAddVar vroot "/wiki" PerlAddVar authen "/home/foo/db/htpasswd" SetHandler perl-script PerlHandler Apache::MiniWiki Require valid-user # or group foo or whatever you want PerlAccessHandler Apache::MiniWiki::access_handler AuthType Basic AuthName "Sample Wiki" AuthUserFile /home/foo/db/htpasswd Require valid-user </Location>
Apache::MiniWiki can also be called by an Apache::Registry CGI script. By running it in this manner, absolutely no changes need to be made to the web server's httpd.conf, as long as Apache has mod_perl built in, and the Apache::Registry (or a module that emulates it) is available.
Copy the example wiki.cgi into your CGI directory and assign it the appropriate permissions. Edit wiki.cgi and set the datadir and vroot variables:
$r->dir_config->add(datadir => '/home/foo/db/wiki/'); $r->dir_config->add(vroot => '/perlcgi/wiki.cgi');
Note #1: This may be a great way of integrating Apache::MiniWiki into an existing site that already has it's own header/footer template system.
Note #2: This method assumes that the site administrator is already using Apache::Registry to speed up CGI's on the site. If they aren't, have them set up mod_perl as it was meant to be. See the mod_perl guide, or try this:
ScriptAlias /perlcgi /path/to/your/cgi-bin/ <Location /perlcgi> SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI </Location>
If you want to use your own template for MiniWiki, you should place the template in the RCS file template,v in the
datadir. Upon execution, MiniWiki will check out this template and use it. If you make any modifications to the RCS file, a new version will be checked out.
You can modify the template from within MiniWiki by visiting the URL http://your.server.name/your-wiki-vroot/(edit)/template
If you don't install a template, a default one will be used.
datadir variable defines where in the filesystem that the RCS files that MiniWiki uses should be stored. This is also where MiniWiki looks for a template to use.
vroot should match the virtual directory that MiniWiki runs under.
If this variable is set, it should point to a standard htpasswd file which MiniWiki has write access to. The function to change a users password is then enabled.
If you create the pages 'list' or 'listchanges', the following will automatically get appended to them:
- list: A simple line deliminated list of all the pages in the system - listchanges: Ordered by date, gives a list of all pages including the last comment, the number of lines added or removed, and the date of the last change
The master 'template' page does not show up in any of these three page listings.
Multiple wiki sites can easily be run on the same server. This can be done by setting up multiple <Location> sections in the httpd.conf, with the appropriate settings.
For an example of automating this using perl, see conf/httpd-perl-startup.pl in the MiniWiki distribution for a sample mod_perl startup file.
Spiders for search engines (Google, OpenFind, etc) love the bounty of links found in a Wiki. Unfortunely, they also follow the Archive, Changes, View, and Revert links. This not only adds to the load on your webserver, but there is a very high chance that pages will get rolled back as the spider goes in circles following links. This has happened! Add these links to your robots.txt so that robots can only view the actual current pages:
Disallow: /wiki/(edit)/ Disallow: /wiki/(log)/ Disallow: /wiki/(revert)/ Disallow: /wiki/(save)/ Disallow: /wiki/(view)/ Disallow: /wiki/lastchanges
See http://www.nyetwork.org/wiki for an example of this module in active use.
Jonas Oberg, <email@example.com>
Wim Kerkhoff, <firstname.lastname@example.org>
James Farrell, <email@example.com>
Brian Lauer, <firstname.lastname@example.org>