This is a fix so that only the config file needs to be edited. It would have been nice to have them all be able to drop straight into the cgi-bin and have no directory structure, but on my hosts Apache server this was not possible.
The idea is to deliver a starter pack that points more easily as to what to alter.
This allows several wikis to run in one cgi-bin just be copying the wiki.pl and the wiki.conf to another pair with the same base name. EG funwiki.pl and funwiki.conf.
One thing that you could do with this change is to set the $DataDir to "./wikidb", and distribute it with a set of starter pages all in one .zip/.tgz file. (You could extract the archive in your cgi-bin directory.)
I'm considering making something like this an option in 1.1, if I have time after fixing the reported bugs. (The setDirNames? function is a good idea--a couple times I have changed the $DataDir in the config file (for special testing), and then I had to copy all the other directory-setting code. --CliffordAdams
<Files ~ "\.conf$"> Order allow,deny Deny from all </Files>...DougConley
--- wiki.1.0.0.pl Thu Sep 12 10:53:14 2002 +++ wikipatch.ConfigOnlyInstall.pl Mon Jan 19 23:05:48 2004 @@ -1,3 +1,4 @@ +#!/usr/bin/perl #!perl # UseModWiki version 1.0 (September 12, 2003) # Copyright (C) 2000-2003 Clifford A. Adams <caadams@usemod.com> @@ -67,7 +68,7 @@ # == Configuration ===================================================== $DataDir = "C:/wikidb"; # Main wiki directory $UseConfig = 1; # 1 = use config file, 0 = do not look for config -$ConfigFile = "$DataDir/config"; # Configuration file +$ConfigFile = "wiki.conf"; # Configuration file # Default configuration (used if UseConfig is 0) $CookieName = "Wiki"; # Name for this wiki (for multi-wiki sites) @@ -197,17 +198,19 @@ # == You should not have to change anything below this line. ============= $IndentLimit = 20; # Maximum depth of nested lists -$PageDir = "$DataDir/page"; # Stores page data -$HtmlDir = "$DataDir/html"; # Stores HTML versions -$UserDir = "$DataDir/user"; # Stores user data -$KeepDir = "$DataDir/keep"; # Stores kept (old) page data -$TempDir = "$DataDir/temp"; # Temporary files and locks -$LockDir = "$TempDir/lock"; # DB is locked if this exists -$InterFile = "$DataDir/intermap"; # Interwiki site->url map -$RcFile = "$DataDir/rclog"; # New RecentChanges logfile -$RcOldFile = "$DataDir/oldrclog"; # Old RecentChanges logfile -$IndexFile = "$DataDir/pageidx"; # List of all pages -$EmailFile = "$DataDir/emails"; # Email notification lists +sub setDirNames { + $PageDir = "$DataDir/page"; # Stores page data + $HtmlDir = "$DataDir/html"; # Stores HTML versions + $UserDir = "$DataDir/user"; # Stores user data + $KeepDir = "$DataDir/keep"; # Stores kept (old) page data + $TempDir = "$DataDir/temp"; # Temporary files and locks + $LockDir = "$TempDir/lock"; # DB is locked if this exists + $InterFile = "$DataDir/intermap"; # Interwiki site->url map + $RcFile = "$DataDir/rclog"; # New RecentChanges logfile + $RcOldFile = "$DataDir/oldrclog"; # Old RecentChanges logfile + $IndexFile = "$DataDir/pageidx"; # List of all pages + $EmailFile = "$DataDir/emails"; # Email notification lists +} if ($RepInterMap) { push @ReplaceableFiles, $InterFile; @@ -215,6 +218,12 @@ # The "main" program, called at the end of this script file. sub DoWikiRequest { + &setDirNames(); + my @Path = split('/', "$ENV{SCRIPT_NAME}"); + my ($Name) = split('\.pl', pop(@Path)); + if (-f $Name.'.conf') { + $ConfigFile = $Name.'.conf'; + } if ($UseConfig && (-f $ConfigFile)) { $ConfigError = ''; if (!do $ConfigFile) { # Some error occurred @@ -228,6 +237,7 @@ # $ConfigError = T('Unknown Error (no error text)'); } } + &setDirNames(); } &InitLinkPatterns(); if (!&DoCacheBrowse()) {