Caching Multiple Wikis

What issues exist when multiple Wiki's are running in the same mod_perl server?

I just discovered a bug in hosting multiple Wikis within a single server. When you list all the pages, it shows pages from other Wikis as well. Haven't investigated yet. -- JF

I think I'm getting that too... I temporarily set up /wiki-dev (using a RAM based filesystem to compare performance) but noticed strangeness. Some pages were coming up as 404 when they shouldn't have been. --Wim

The current code stores the parsed template (HTML::Template object) as a global variable, so it is read once and there cannot be multiple templates for different sites. I'll look at this in greater detail, but I'm sure there's a better way to cache the template files, using HTML::Template's own caching mechanism. It'll probably be a little tricky, though, to make it work nicely with RCS. -- JF

I tried taking out the MiniWiki template caching code and letting HTML::Template handle it. However, I'm still getting a problem that $datadir, $vroot, etc are still shared. So, if a page in /a is loaded first, then any request for pages in the /b wiki are pulled out of the /a data directory instead of the /b data directory. Same for the other way around. I'm doing some more research into global variables now. Really, the global objects should be removed, and things passed as parameters... but that is ugly too. --Wim

Some time later... I have multiple wikis (well, only two) working fine. Each uses its own template, and loads the correct pages, and links properly. I'll commit after finishing some other cleanups. See HTML::Template for an example of caching templates. --Wim

I've committed my various changes, as well as reorganized the documentation. I have three Wiki's (all with different authentication methods and different templates) working fine now. --Wim

I'm using your code right now, and it works great! You're absolutely right that $datadir, $vroot, etc were being cached as globals ... getting rid of that was the quick and dirty change I made to get multiple wikis working at all. Sorry for not letting you know about that more specifically. I committed a change that puts back code making sure the template file is checked out from template,v before loading it. Also, thanks very much for the work on the documentation. -- JF

Hey, thought you disappared :-) I've got a bunch of other changes that I haven't committed either. Hopefully my SSH keys Savannah still work. It's been so long since I've made these changes that I'll have to see what they actually were. I think they mostly had to do with blacklisting spammers. --Wim