Questions And Answers

Q: I've tried out your WikiWikiWeb program, but when I set it up to run at my host, it doesn't seem to accept too long messages. 1k (before decoding) seems to be close to the limit. On you obviously don't have the same problem, which leads me to think that perl is the culprit.

A: I've been disappointed with the dbm facilities in perl, though I have found the rest of the language to be excellent. It seems that there are a wide variety of dbm library implementations, many of which limit the size of strings to about 1k. I am using the version from Berkely that was linked into perl by my operating systems vendor, BSDI. It places no limit on the length of strings. Even so, I've had trouble getting my version to reliably enumerate keys. Several people have modified wiki to use files in a directory instead. You might consider doing likewise if you have long file names on your system.

Q: Did you intend that the name (and location) of the database be independent of the script? I see an environment variable for script name, but don't know how it's to be set, and in any event it ties the paths together (running without a value, the DB has the same name as the script)

A: Yes. My server (NCSA httpd) sets up the environment variables. I keep a copy of wiki, called wacky, that I edit and test. When a new feature is working, I can replace the script for wiki without any modification. In fact, I'd like wiki and wikibase to be links to the same script.

Q: I'd like to add headings. A coding that comes to mind that seems to have the right feel is that n leading (unindented) '.'s would make the rest of the line an Hn.

A: I'm not sure you really want to offer all n heading styles. Do you think one would be enough? How about recognizing a line of words in all caps? When you see ...


you could translate it to ...

  <H1>Appendix 3: Device Codes For The Framilwitz</H1>

I suppose another idea would be to look for section numbers and try to figure out the heading level form the structure of the number. For example ...

  3.1.1 Exceptions Handled by the Framilwitz

... would be recognized as a level three heading because the section number had three parts.

A: I hacked headings into our wiki by adding the following lines to PrintBodyText:

	s/^\*\*(.+)$/<h3>$1<\/h3>/    && &EmitCode("", 0);             
	s/^\*(.+)$/<h2>$1<\/h2>/      && &EmitCode("", 0);             

That is, begin the line with n asterisks to get the rest of the line set as <hn-1>. (The use of the asterisks (sort of) mirrors that for bulleted lists, and doesn't seem likely to conflict with much normal text.) No complaints so far. -- ?DavidBruce

Q: Why do you destroy the indenting of the script when you generate the straight perl code?

A: I did it in a hurry to get the EOF lines to work. I'll bet there are better solutions that haven't come to me yet. It did get me thinking, if I gave away everything except the indenting, then people would be motivated to keep coming back to my site to see the source.

Q: I have installed a modified wiki script under httpd in my cgi-bin directory. When I try to access it I get an error 500 with a message talking about a malformed header from the script. I have not been able to find out what is going on and compare it with the one that works. Help please. -- JohnFletcher

A: I wonder if your web server couldn't launch wiki? Is the perl path in the first line correct? My server writes error messages to a log when my scrips blow up. Try looking at the tail end of your error log.

Q: Why are the scripts sometimes run from /cgi-bin and sometimes from /cgi? Does this matter?

A: Most web servers recognize cgi-bin as a signal to look in yet another directory. I added a configuration command to my server to use cgi as a synonym for cgi-bin. Both refer to the same directory.

Q: How do I set up the first page to get things started?

A: Wiki will create an empty database the first time it runs. You will get a page that reads Describe FrontPage here. Use the edit button and start typing.

Q: I'm having trouble getting started. Rather than a new db being created, I'm getting an error when it tries to open my db. Perhaps my ISP has disabled DBM.

A: It could also be that the script, when run, doesn't have permission to write the file. Try creating an empty file and giving the world read/write permission.

Some ISP's have quirky rules about allowing CGIs to execute in writable directories. My ISP requires that I keep CGIs in a write-protected directory. I use a separate, writable sub-directory for world-writable files. --DaveSmith

I ran into this yesterday, setting up wiki on a NetBSD box. I found that the directory containing the db must also have world read/write permission. -- LarryKollar

Q:Ward said above that "several people have modified wiki to use files in a directory instead [of using DBM]". Can some of those people say more about how they accomplished this? --TomStambaugh

A:You might look at SWiki, built by MarkGuzdial at Georgia Tech. It's a part of his PluggableWebServer.

A2:AustinDavid has a functional wiki that does this- mailto:austin@modusopera ... ubject=wiki.hack for a copy

A3:RobDaasch has posted a .tar file at ... aasch/wiki.tar.Z that uses a subdirectory and files instead of DBM.

A4:PeterMerel has a WikiClone called CvWiki that uses flat files for text, supports direct transclusion, stores backlinks with their pages rather than searching for them (so backlinks scale fine), is fully integrated with a versioning tool so you've got unlimited undo, a fix for edit collisions, and WayBackMode. There are several smaller twiddles in it too, though it's backward-compatible with the existing wikibase. (Isn't this supposed to be obsoleted by AtisWiki? --JeanJordaan)

Q: Ward, does your Perl support flock()? That'd have to be an improvement (in RequestLock) over sleeping, particularly if you're having CGI timeout problems. --DaveSmith

A: This sounds like a good suggestion. RequestLock is a contribution that dates back to my first troubles with the dbm library.

I've now finally resolved this problem in my big wiki by upgrading to perl5 and using:

  use GDBM_File ;
  tie %db, 'GDBM_File', "$DBM.db", &GDBM_READER, 0666 or &abort("can't open $DBM.db");

in place of:

  dbmopen(%db, $DBM , 0666) || &abort("can't open $DBM");

The following works for me using DB_File (under FreeBSD). It takes advantage of there already being an open file for use as a lock. Perhaps a similar trick can be done with GDBM_File. --DaveSmith

    use DB_File;
    $db = tie %db, 'DB_File', $database, O_RDWR, 0644, $DB_HASH || die "...";

# duplicate the file descriptor for use as a lock $fd = $db->fd; open(LOCK, "+<&=$fd) || die "...";

flock(LOCK, LOCK_EX) || die "..."; $db{key} = "Hey, I have an exlcusive lock!"; flock(LOCK, LOCK_UN) || die "...";

close(LOCK); untie %db;

Q: Will WikiWikiWeb run under anything other than UNIX (for those poor souls thus afflicted)? Specifically, can I get it to run on a Windows NT server?

A: TimO'Connor (currently known to Wiki as TfOc) has found that Ward's WikiInStraightPerl will run without modification under Windows NT 4.x using the Apache 1.3b3 web server and PERL 5.004_02. Go to TfOc for more info. PeterMerel also seems to have it running under NT. JeanJordaan has Ward's plain vanilla running under Windows 95, using the Xitami webserver (but the DBM <1Kb bug is biting). (See )

Q: My tests with a Wiki clone suggest that having PrintBodyText assemble and print html in one chunk, rather than line by line, leads to snappier page printing. Any comments from other Wiki porters? Do your CGIs respond quicker if you minimize the number of write()s from the CGI process to the server process? (I'm using an NCSA-derived server.) --DaveSmith

Q: I've installed a wiki server at ... cgi-bin/wiki.cgi My problem is that the server bombs out in the middle of updating certain pages (like FindPage), returning Document contains no data and leaving the lock directory hanging. Anyone know what causes this, or how to fix it? We have a vanilla installation, with only some configuration variables set. I have read the source code, but do not see what can be the cause. -- OscarNierstrasz

A: I don't have a ready answer. Try checking the tail end of the server's error log. If perl wrote anything to standard-error on the way out it would appear there. -- WardCunningham

A: To make a long story short, investigation eventually revealed that my problem was the same as the first one listed above, namely that our installation of dbm chokes for values that are more than 1K. In our case problems started when the RecentChanges page. hit 1K.

As a result of this problems, I have decided to install a wiki based on plain text files and RCS instead of dbm (see also comments above). Since I could not find a wiki clone that did this and was easy to install, I wrote my own by hacking the WikiInStraightPerl into something I call RcsWiki.

For details, see the new ?SoftwareCompositionWiki at: ... -bin/scgwiki.cgi
-- OscarNierstrasz

Q: I'm having some problems w/ DBM. wiki created the database fine (as I added group write perms to the directory), but I can't create a second page to the wiki. My error logs turn up:

  [17/May/1999:23:37:24] failure: for host trying to POST
  /~ryand/wiki.cgi, cgi-parse-output reports: the CGI program
  /media/people/ryand/public_html/wiki.cgi did not produce a valid header (name
  without value: got line "timed out waiting for /tmp/wiki.cgi")

I've checked out /tmp/wiki.cgi and it exists w/ full write perms. So what is up? -- RyanDavis

A: I just answered this one for myself. Blow away /tmp/wiki.cgi, it must have been left around when a previous problem cropped up. -- RyanDavis

ChrisGarrod lived on Solaris with the 1k DbmProblem for a long time, and hacked at the code till it stopped crashing before the limit got hit. In the meantime, he kind of got hooked on the idea of SmallPages after all.

Q: I'm trying to get the wiki source to run on Solaris8 and I'm getting a lot of problems with the unitialized variable errors. I get them on the line that defines $SearchForm and also on a line that defines html that appears to be outside of the subroutines but sprinkled in just before the CookSpaces subroutine. I don't know if there is a missing paren or something else. Also, since the $db can't find any pages to begin with, it tries to create the define front page here page - but it gets an uninitialized variable error with the $old(date). Also, I tried the WikiStandardPages script but when I run it, I get an error when it tries to find the non-existent $?InstallPage routine. Where is the code for that?

-- MikeCorum



Last edited February 12, 2002
Return to WelcomeVisitors