create new tag
, view all tags

Update, Mar 2002

  • NOTE: I've done a complete WindowsInstallCookbook, using Cygwin for everything except Apache, based in part on the excellent tips on this page. This is much easier to follow.
    • In particular, note that the RCS installation is now trivial (just another Cygwin package), and that binmode filesystem mounts are essential to avoid Cygwin RCS problems (and tested as part of the install). I used the non-Cygwin Apache for Windows port, largely because I already had it installed - however, it does make it easy to run Apache as a service, at the cost of some more complex config. -- RichardDonkin - 25 Feb 2002
  • Edited some of the topics below to fix errors - in particular, I deleted the sections on compiling RCS since this is no longer necessary (RCS is now a binary package installed by Cygwin setup) -- RichardDonkin - 29 Mar 2002

Refactored, Nov 2001

After much tweaking and scratching my head, I found the following steps to work.


Installing Cygwin

Cygwin installation was easy:

  • Download setup.exe and run it.
  • Select "Install from Web", or first select "Download", then run setup.exe again and select "Install from local directory".

After that, bash and most Unix tools ran right out of the box.
(I remember times when this was much more complicated.)

Binary mode mounts are still very important - TWiki can handle text mode, but Cygwin RCS will corrupt RCS files if used without binmode mounts. See WindowsInstallCookbook's Cygwin section for details.

Installing Perl

Perl 5.004 came preinstalled with Cygwin, so no real issues exist.

  • Perl 5.005_03 is the oldest supported version for TWiki - older versions may not work -- RD

However, TWiki needs additional modules to perform various functions.

TWiki function Perl Module Download from
Basic Authentication Digest::SHA1 http://www.cpan.org/authors/id/GAAS/Digest-SHA1-2.00.tar.gz

If the download location doesn't give you the file, try locating the module via http://search.cpan.org.

Method 1: via download

Installation is via the following steps:

  • Download module into a local directory
  • cd to that directory
  • gunzip -c <module-name>.tar.gz | tar -x
  • cd <module-name>
  • perl Makefile.PL
  • make
  • make test
  • make install
The important step is make test; if this fails, installation is probably impossible.
However, file-related tests often give a false negative since Cygwin file handling can be different from the vanilla Unix behavior that most Perl modules expect.

Note that it's important to use the gunzip/tar combo, not WinZip or any other DOS/Windows tool to unpack the tar.gz archive. They don't know about Unix links, and they will most likely try to guess about line ending conventions (that's something that we do not want; e.g. this causes the SHA test to fail).

Method 2: via CPAN

From a bash shell:

   $ cpan
   cpan> install Digest::SHA1

If you have not CPAN before you will be asked some configuration questions. The defaults seem to work fine.

As with method one, if make test fails you are probably stuck.

Installing Apache

This presented me with a gotcha: Apache wouldn't start.

Reason: the DLLs were "linked statically" (i.e. have to be loaded during start-up time).

Quickfix: I added the following line near the top of /usr/local/apache/bin/apachectl:

I sent a bug report to the Apache team, so one of the next versions should have this fixed.

I added several shortcuts to my Start menu, which proved quite handy when it came to configuring and controlling Apache.

These were:

   D:\cygwin\bin\bash.exe --login /usr/local/apache/bin/apachectl start
   D:\cygwin\bin\bash.exe --login /usr/local/apache/bin/apachectl stop
   D:\cygwin\bin\bash.exe --login /usr/local/apache/bin/apachectl restart
   D:\cygwin\bin\bash.exe --login /usr/local/apache/bin/apachectl graceful
Note the --login option, which makes bash add the usual suspects (/bin, local/bin etc.) to its $PATH before executing the command.

The problem with these shortcuts is that the window will close before you have a chance to read all the messages. As a workaround create this batch file and have your shortcut point to it instead:

   C:\unix\bin\bash.exe --login /usr/local/apache/bin/apachectl start
   @echo off
   echo    Press any key to close this window 
   echo    (apache will continue runing as a background process,
   echo    assuming there are no errors listed)
   pause > nul
[mw 04 Dec 01]

I also added a few URL shortcuts to the Start menu, namely

(Note that httpd.conf settings have an influence on these commands: server-status will become a bit more verbose if you set the appropriate flags, and server-info will not work until you enable it. Alle these settings are in httpd.conf.)

I added the following directives at the end of httpd.conf:

  # Environment variables for TWiki
  <IfModule mod_env.c>
      SetEnv TZ CET-1CST
      SetEnv LOGNAME nobody
      SetEnv TEMP /tmp
      SetEnv TMP /tmp
      SetEnv HOME /usr/local/twiki
Also, if httpd.conf hadn't already had the lines
  LoadModule env_module         libexec/mod_env.dll
  AddModule mod_env.c
I'd have added them at the appropriate places (mod_env goes between mod_vhost_alias and mod_log_config on the standard setup).

RCS installation

This is now very easy - just select the rcs package in Cygwin setup. Make sure you are using binary mode Cygwin mounts (described elsewhere on this page). (Have deleted older info about compiling RCS).

Installing TWiki

Installing TWiki was as per TWikiInstallationGuide, with some little help from TWikiOnWindows.

One major gotcha here was that Apache did not accept Windows names! This means that I had to install TWiki somewhere in my C:/cygwin tree, else Apache wouldn't recognize the documents or CGIs.

Since RCS and diffutils insist on Windows names, I got the moderately funny situation that my httpd.conf says /data/joachim/twiki/bin where my twiki.cfg says D:/cygwin/data/joachim/twiki/bin.

  • The Cygwin versions of RCS and diffutils are fine with Windows pathnames such as d:/foo/bar, of course, so this is not a problem if you just use those versions rather than compiling RCS from scratch. If you want to stay with a hand-compiled RCS, there's an 'LF_ONLY' variable (check TWiki for the actual name) used by RCS. This might also indicate a problem with your Cygwin mounts (try to have c:/ mounted as /, in binary mode) -- RD

This problem is probably a consequence of recent tweaking in the mounting facilities of Cygwin and may go away with future Cygwin releases.

-- JoachimDurchholz - 18 Nov 2001


Nice refactoring job Joachim

I have cygwin and twiki installed on seperate drives without any problems (well, without the problems mentioned above). Cygwin is installed to c:\unix and Twiki is under g:\www\. All of my configuration files (httpd.conf, twiki.cfg) are using unix paths.

From a bash shell:

$ mkdir /www (create empty mount point directory)
$ mount --force --system --binary "G:/www" "/www"

  • The mount command on Cygwin always writes to the registry. The '--system' option means that these changes affect all users of the system, not just the logged-on user. --RD

My mount table now looks like this:

   $ mount -m
   mount -f -s -t "C:/unix/bin" "/usr/bin"
   mount -f -s -t "C:/unix/lib" "/usr/lib"
   mount -f -s -t "C:/unix" "/"
   mount -f -s -b "G:/www" "/www"
   mount    -b --change-cygdrive-prefix "/cygdrive"

  • This mount setup is quite dangerous, IMO - it is much better to use binary mode mounts for everything, including C:/ or wherever your temp dir is located, so that any temp files generated by TWiki-launched programs are also in binary mode. See WindowsInstallCookbook for details. -- RD

  • Cygwin version 1.3.3(0.46/3/2) 2001-09-12 23:54,
    • setup-timestamp: 1005073803
    • setup-version:
  • binary Apache 1.3.20 from http://apache.dev.wapme.net/packages/ (earlier I had 1.3.22-binary running, also using unix paths)

-- MattWilkie - 20 Nov 2001

Thanks smile you're welcome!
The authors of the Older Stuff below should weed out or integrate it, so that this topic become less of a series of war stories and more of a working set of instructions.

Re path problems:
I'm pretty sure that they are a Cygwin bug. The Cygwin guys have been working on the path mapping code recently, and there's hope that they'll fix the problems in one of the next releases.

_I won't be upgrading Cygwin for awhile then. : ) Somebody please post a notice when the Cygwin pathing problem is known to be fixed --Main.MattWilkie 21 Nov 2001

  • I've not had this problem, using Cygwin 1.3.9 and 1.3.10, so I'm not convinced it's a Cygwin bug - see comments above about using the 'rcs' binary package and mount setup. --RD

-- JoachimDurchholz - 21 Nov 2001

Older stuff

I've managed to somehow install twiki using cygwin.
Problem : there is a bug on win98 that prevent cgi from terminating, to be tested on nt/2000.

What i've used :

Install Cygwin

Use the setup.exe provided. You should have all including perl, gcc etc...

Note that you need gcc and make as part of installing Perl modules. See WindowsInstallCookbook for the exact list of Cygwin packages required.

Install apache

Untar the archive and follow the instructions. (if I remember well there is an install script which works well)

  • Deleted info about compiling RCS, no longer necessary on Cygwin. -- RD

installing Twiki

I then put the twiki distribution in /usr/local/apache/htdocs/ and rename the main folder to twiki

Setting up environent

See top in the paragraph on Apache installation.

Note that neither PERL5LIB nor RCSINIT are needed.

-- JoachimDurchholz - 17 Nov 2001

Apache Configuration

[Snipped - TWikiInstallationGuide already describes this step.]

-- JoachimDurchholz - 17 Nov 2001

RCS lock

[Snipped - TWikiInstallationGuide already describes this step.]

-- JoachimDurchholz - 17 Nov 2001

Setting up TWiki

[Snipped - TWikiInstallationGuide already describes this step.]

I'll add this stuff at the end, as this is my first real contribution to TWiki, perhaps someone else would like to combine this properly,

I also installed TWikiOnCygwin, briefly the steps were:

  • Install Cygwin (I got the latest version 1.3.3)
  • Grab the Perl Mods required for a TWikiOnWindows install, get the latest versions direct from http://www.cpan.org. To install each I ran perl Makefile.pl; make; make test; make install. You will need to know your smtp server if you want the email to work.
    • libnet - for the NET::SMTP package
    • digest-SHA1
    • MIME-base64
  • Install Apache. I set up the /usr/local/apache/conf/httpd.conf for my server to test that I had this working before continuing. I changed:
  • Install GNU diffutils package. If I didn't install this I found that RCS wouldn't configure. Get it from ftp://ftp.gnu.org/gnu/diffutils.
  • Install RCS (use ./configure --with-diffutils). Please make sure you also do the changes to the source code listed above.
  • Install TWiki. I followed the instructions in the TWikiReferenceManual, putting the code into /home/httpd/TWiki/ and the data and template directories into /home/TWiki/
  • Set up the Apache configuration for TWiki directories /usr/local/apache/conf/httpd.conf as below
ScriptAlias /twiki/bin/ "/home/httpd/TWiki/bin/"
Alias /twiki/ "/home/httpd/TWiki/"
<Directory "/home/httpd/TWiki/bin/">
   AllowOverride All
   Options +ExecCGI
   SetHandler cgi-script
   Allow from all
<Directory "/home/httpd/TWiki/">
   Options FollowSymLinks +Includes
   AllowOverride None
   Allow from all
  • Set up the TWiki.cfg file as below
# variables that need to be changed when installing on a new server:
# ==================================================================
#                   %WIKIHOMEURL% : link of TWiki icon in upper left corner :
$wikiHomeUrl      = "http://server_name:port/twiki";
#                   Host of TWiki URL :    (Example "http://myhost.com:123")
$defaultUrlHost   = "http://server_name:port";
#                   %SCRIPTURLPATH% : cgi-bin path of TWiki URL:
$scriptUrlPath    = "/twiki/bin";
#                   %PUBURLPATH% : Public data path of TWiki URL (root of attachments) :
$pubUrlPath       = "/twiki/pub";
#                   Public data directory, must match $pubUrlPath :
$pubDir           = "/home/httpd/twiki/pub";
#                   Template directory :
$templateDir      = "/home/twiki/templates";
#                   Data (topic files) root directory :
$dataDir          = "/home/twiki/data";

#                   RCS directory (find out by 'which rcs') :
$rcsDir           = "/usr/local/bin";
  • Set up access control through Apache by using mv /home/httpd/TWiki/bin/.htaccess.txt /home/httpd/TWiki/bin/.htaccess and then editing the relevant bits in the file.

Hope thats useful. If no one else incorporates this I'll try and get some time to do it next week.

-- TomMcMillen - 03 Oct 2001

I found it easier to get RCS to work by using the ./configure option --prefix/usr rather than the default of /usr/local

With Apache for Windows I couldn't get some of the scripts to run, notably WebChanges and WebIndex, until I removed taint checking from all of the scripts in /twiki/bin, which is completely insecure and NOT recommended, change:

#!c:/path to perl/perl -wT
#!c:/path to perl/perl -w

There is a possible regedit hack in TWikiOnWindows#Notes_on_security which I didn't try.

With Apache for Cygwin all of the TWiki scripts run out of the box, however I have been unable to get Basic Authentication to work. : ( See AuthenticationProblem

-- MattWilkie - 24 Oct 2001 (updated 20 Nov 2001)

I just discovered something interesting: TWikiOnCygwin is case insensitive for some operations. For instance in the Go form, 'webhome' is identical to 'WebHome' which is certainly not the case on twiki.org.

I don't know if this case blindness is an out of the box feature or because I turned it on by enabling it in my .bashrc and .inputrc. howto

Please don't break this bug-which-is-a-feature unless you really need to. smile

-- MattWilkie - 25 Oct 2001

I don't think .bashrc or .inputrc would affect this - most likely it's an unintended consequence of Windows file systems being case insensitive on filename matching (although case-preserving for filename storage).

-- RichardDonkin - 30 Oct 2001

See TopicCaseSensitivity for a continuation of this subject.

-- MartinCleaver - 1 Nov 2001

Binmode mounts in Cygwin are still a big issue for RCS - without them you get file corruption due to RCS (at least the CygWin version - the GNU ported version has an RCS_LF_ONLY=1 variable that should fix this).

Also, until I had TWiki on a binmode mount, I found that every topic had doubled lines - this may have been due to RCS, but required a patch to Store.pm or TWiki.pm that was no longer needed with a binmode mount.

See WindowsInstallCookbook for a complete installation recipe using Cygwin for Perl, RCS and most other things (apart from Apache).

-- RichardDonkin - 25 Feb 2002

Quite a few updates above, to correct errors and out of date info, based on experience of writing WindowsInstallCookbook (mostly Cygwin based, and tested by quite a few people now) and moving Apache for Win32 setup over to Apache for CygWin.

If you are developing TWiki code, Apache for Cygwin is a good choice, because it lets you keep the shebang line unchanged, pointing at /usr/bin/perl - Cygwin also includes cvs so you can download TWikiAlphaReleases easily, or use it for local version control (see CvsReadme).

See also TWikiOnWindowsUsingApache for more on Apache config (for Win32 not Cygwin), and TWikiOnCygwinApacheScripts for some useful scripts to run Apache as a service on Cygwin.

-- RichardDonkin - 29 Mar 2002

Edit | Attach | Watch | Print version | History: r39 < r38 < r37 < r36 < r35 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r39 - 2003-12-14 - PeterThoeny
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.