Tags:
installation1Add my vote for this tag windows1Add my vote for this tag create new tag
, view all tags

Windows+IIS+CygwinPerl Installation Cookbook

This document should be used with Caution. Unless you consider yourself expert with Cygwin, IIS and Perl you should use the Apache/Cygwin-based WindowsInstallCookbook instructions.

I say this because:

  • Main.DougRansom sent me an email to say that he'd given up on TWiki and was now working with SushiWiki instead.
  • Main.TorbenGB told me on TWikiIRC that he'd given up on IIS and was working with the Apache-based TWikiOnWindows instructions

Going forward, I'd like to suggest that:

Buyer beware... beyond this point lie dragons.

-- MartinCleaver - 10 Jul 2003


This topic provides a short list of outcomes and main traps MarkusKling encountered while installing TWiki for the first time on Windows, CygwinPerl and IIS. Please start reading at the WindowsInstallCookbook since here you will only find very brief descriptions of the minimum required steps.

Software Requirements

Installation

CYGWIN

  • Run cygwin.bat
  • Mount the drive where your TWiki installation resides as binary type (for instance e:\)
    • mkdir /e
    • mount -b e:/ /e

RCS

  • My-Computer -> System Properties -> Environment -> System Variables
    • add cygwin/bin, perl/bin to the PATH variable
    • add LOGNAME = anonymous
    • add RCSINIT = -x,v

  • Goto the data directory. For each subdirectory type
    • rcs -u *.txt (answer break-lock questions with "yes")
    • rcs -l *.txt

IIS

  • Start IIS
  • Open MMC
  • Create Virtual Directory pointing to your twiki directory
  • Change Authentication to Basic & Integrated Windows Authentication
  • Point MMC to the bin directory and select Properties
    • Create an Application
    • Select "Scripts and Executables"
    • Configure ".pl", ".plx" within "Application Mappings" that they don't check that the file exists

  • Now you must REBOOT your server in order that the environment variables you set before take effect for the "SYSTEM" user

Configure TWiki

  • Goto bin
    • type rename * *.pl
  • Open lib\Twiki.cfg
    • Point wikiHomeUrl, defaultUrlHost, scriptUrlPath, pubUrlPath, pubDir, templateDir, dataDir to the appropriate pathes. Use fully qualified names in "/" notation for your paths!
    • set scriptSuffix to .pl
    • add "cygwin\\bin" and "winnt\\system32" to the safeEnvPath. Use the "d:\\" Notation for your pathes!
    • set rcsArg to -x,v
    • Edit rcsDir, revInitBinaryCmd, revCiCmd, revCiDateCmd, revCoCmd, revHistCmd, revInfoCmd, revDiffCmd, revDelRevCmd, revUnlockCmd, revLockCmd, revBreakLockCmd. Use "d:\\" notation and add ".exe" to the commands.
    • Edit lsCmd, egrepCmd, fgrepCmd. Use full qualified names in "d:\\" notation and add ".exe" to the commands. Keep in mind that there don't exist an fgrep command; fgrep must also point to grep.exe.
      • Specify the -E option on the $egrepCmd setting, e.g. "c:\\cygwin\\bin\\grep -E". (Necessary with more recent Cygwin versions.)
      • Specify the -F option on the $fgrepCmd setting, e.g. "c:\\cygwin\\bin\\grep -F".

  • Test your configuration, pointing the browser to "url/twiki/bin/view.pl"

Code Changes

  • Store.pm
    • remove the 2>&1 1>$TWiki::nullDev from all commands.
  • Search.pm
    • Search for if( $theRegex ) and add . " -E" to the egrep command in order to support regular expressions. - not needed, done by editing TWiki.cfg above.

Authentication

The TWiki can interact with the built in IIS authentication. So you can map users from your NT domain to TWiki users while providing their case sensitive intrantet-login name via registration. Use the ASP below to query your actual username.

   example.asp
   <%=Request.ServerVariables("AUTH_USER")%>

In order to receive a TWikiGuest when the user is not remembered edit TWiki::userToWikiName and change

   my $wUser = $userToWikiList{ $loginUser } || $loginUser;
   to
   my $wUser = $userToWikiList{ $loginUser } || $defaultUserName;
Than edit TWiki.cfg and set the defaultUserName to TWikiGuest.

-- MarkusKling - 15 Jul 2002

In the Application for the bin directory, I had to add -T to the perl command associated with the .pl extension in order to get around a Too late for for "-T" option error when testing view.pl (IIS 5.1 on WinXP). Also, for pubDir, templateDir, and dataDir I had to use Windows notation to get view.pl to work (i.e. /c/TWiki/pub didn't work, but c:\\TWiki\\pub did work). TWiki20011201.zip.

-- DavidMurray - 10 Oct 2002

The /c/TWiki/pub notation doesn't work because you are using ActivePerl not CygWin Perl. I've also made an update above so people don't need to edit Search.pm. The WindowsInstallCookbook settings for fgrep and egrep options (-F and -E, I think) can be used if you have problems.

-- RichardDonkin - 06 Dec 2002

"Point wikiHomeUrl, defaultUrlHost, scriptUrlPath, pubUrlPath, pubDir, templateDir, dataDir to the appropriate pathes. Use fully qualified names in "/" notation for your paths! " "Edit rcsDir, revInitBinaryCmd, revCiCmd, revCiDateCmd, revCoCmd, revHistCmd, revInfoCmd, revDiffCmd, revDelRevCmd, revUnlockCmd, revLockCmd, revBreakLockCmd. Use "d:\\" notation and add ".exe" to the commands. "

"Create Virtual Directory pointing to your twiki directory". Which is the twiki directory

installdir/twiki?
installdir/twiki/data?
installdir/twiki/data/twiki?
installdir/twiki/data/main?

I wish I understood what these meant and what I should change them to. A little more handholding in the instructions would be nice.

I think it would be insightful to have a complete example. List the virtual dirs set up in IIS, the absolute directories twiki is installed to, and a concrete example of every variable listed above.

-- DougRansom 24 Dec 2002 --

For W2K Server with IIS & ActiveState had to add the -T to the perl command. It looks like this: D:\apps\Perl\bin\perl.exe -T "%s" %s

I don't understand the motivation to remove the 2>&1 1>$TWiki::nullDev from all commands and have not yet done this.

It worries me that I see a shell flash on the server when I edit a wiki page using a browser running on the server itself.

-- DougRansom - 24 Dec 2002

I followed the mount instructions (to the best of my ability anyway ☻) The value for data dir /d/apps/twiki/data/ doesn't work, but d:/apps/twiki/data/ does work. "mount" displays:

d: on /d type system (binmode)

I think this is causing me problems and the one area I could really use some help on.

-- DougRansom - 24 Dec 2002

A performance improvement may be possible using ISAPI instead of CGI to run the perl scripts. ISAPI for perl

-- DougRansom - 25 Dec 2002

Hi Doug, don't worry wink

  • The TWiki directory is the main directory of your installation containing at least the "/bin" and the "/pub" directory.
  • I had to remove the 2>&1 1>$TWiki::nullDev from some commands in order to have them executed correctly. Maybe this has been fixed since today.
  • If you're using CYGWIN then the mount point is only for the cygwin.dll (and executables using it) to access the files correctly. You must still use Windows notations for TWiki pathes if you use the ActiveStatePerl executable/dll.
  • I could not execute all scripts correctly using the Perl ISAPI plugin. Had some problems regarding POST/GET and HTTP refreshes. Would be nice if you state some of your experiences.

-- MarkusKling - 26 Dec 2002

I have not actually tried the Perl ISAPI filter yet instead of the CGI because I have yet to get twiki working. I am having problems similar to GettingRCSToWorkWithIIS. I can change a page, and view the change in wiki, but others cannot edit the same wiki page because its locked by me (even though I have a finished my edits), and my changes never show up in the diffs and the rcs version number does not increase. Obviously, my edits are not sucessfully checked in.

I thought this might bee due to the mount behavior I described on Dec 24.

I am at a loss of what to do next. I am using ActiveStatePerl. All help appreciated.

-- DougRansom - 26 Dec 2002

Finally after hours of digging around, I found I had to change LOGNAME to "nobody". The instructions above say "anonymous". During hacking about, I also changed some environment variables, tried cygwin perl (didn't get it going), went back to activeState perl, and gave everyone full access to the twiki directory. Not sure which of these are required.

-- DougRansom - 30 Dec 2002

Attachments don't work, but otherwise RCS seems to work. I am curious as to whether I have incorrectly set one of the variables in twiki.cfg -- I have attached that file to DougsInstallOnIIS.

-- DougRansom - 30 Dec 2002

Just found a useful page with Tips on IIS4 and Perl while looking for something else smile

-- RichardDonkin - 23 Feb 2003

Have these instructions been tested with the Beijing code base? Against IIS 5.1?

-- MarkLevison - 27 Feb 2003

MarkLevison, I'm currently trying to install Twiki 20030201 onto Windows XP Pro with IIS 5.1 ... so far I have found some discrepancies but a skilled person should be able to get it working anyway.

I am discovering that I am not skilled enough for this. But then again, some webserver and perl skills are stated in the requirements to use Twiki, so this is more a blame on me than on Twiki. So far, I have it partially running but I grapple with some configuration issues to make the Perl (v5.6.1) run without complaints.

I chose to not use ActivePerl v5.8 even though I have it, because I was afraid it would get even more complicated (more discrepancies). I've read here on Codev that there are issues with v5.8 as well, so I thought v5.6.1 was the safer road.

-- TorbenGB - 10 May 2003

Common Traps

Mount failing for RCS

Cygwin apparently changed the Mount command. "mount -b C:\ /c" doesn't seem to work try:

"ln -s /cygdrive/c/ c"

It will create a symbiolic link to the C drive, which was automounted by Cygwin under the cygdrive directory and thus mount barfs on it.

-- NormanKing - 03 Sep 2002

The problem here is that you are using the Cygwin shell (bash), which interprets '\' specially, and are specifying c:\ instead of c:/ with the CygWin mount command. Alternatively, you can type c:\\ (because '\' is a special character it must be doubled), but it's easier to use c:/, which works OK with ActivePerl, Apache and almost all Windows programs as well (the main exceptions are Microsoft Office and cmd.exe / command.com).

The following works with the latest version of Cygwin:

$ mkdir /c
$ mount -b -s c:/ /c
$ mount
...
c: on /c type system (binmode)
...

This is a bit cleaner than using symbolic links, since you can type mount to see the mappings, and works OK for filename completion as well.

I have fixed the cookbook's mount command (in cygwin section, above) to use e:/, since this will work in all cases, and the cookbook said to run the cygwin.bat command.

One Cygwin tip - create a shortcut to C:\cygwin\bin\bash.exe --login and use that instead of the cygwin.bat file - this avoids starting up a virtual DOS machine and is much faster.

-- RichardDonkin - 04 Sep 2002

Further modifications

Index Server

IndexServerSearchForMsIisAddOn provides a way to replace the SearchCgiScript with one that uses MS Index Server.

-- MartinCleaver

Edit | Attach | Watch | Print version | History: r28 < r27 < r26 < r25 < r24 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r28 - 2004-12-20 - RichardDonkin
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.