installation1Add my vote for this tag create new tag
, view all tags
ALERT! NOTE: This is a SupplementalDocument topic which is not included with the official TWiki distribution. Please help maintain high quality documentation by fixing any errors or incomplete content. Put questions and suggestions concerning the documentation of this topic in the comments section below! Use the Support web for problems you are having using TWiki.

ALERT! NOTE: This is a HistoricalDocument topic. It used to be distributed in an earlier TWiki release, but is no longer part of the official TWiki distribution. Post questions, error notes, and suggestions concerning the documentation of this topic in the comments section below! Use the Support web for problems you are having using TWiki.

Nutshell Summary of Windows Install Cookbook

ALERT! NOTE The following is out of date, you can no longer download perl 5.6 for Cygwin. For an easy to install TWiki on Windows see DownloadTWikiVM. For personal use see TWikiForWindowsPersonal.

This summary of WindowsInstallCookbook is for you if:

  • You've already installed TWiki on Windows before and want a quick refresher of the important points.
  • You've never installed TWiki on Windows before, but find the WindowsInstallCookbook too much to swallow right now. It is recommended you read through this summary to build a picture of the overall process, and then use the full cookbook as your guide as you actually do the install.

Table of Content:

The Essentials

TWiki will run on any combination of Operating System + Perl + Webserver. TWiki requires all three but doesn't care which three. Each permutation has its own quirks to deal with. Which combination is easiest depends on your personal background and experience. This guide covers only one possible configuration of many: Windows 2000/XP + Perl-Cygwin + Apache-Win32.

TWiki also requires the RCS revision control system but is more picky about which flavour (this guide uses RCS-cygwin).

Head to http://twiki.org/ and download the latest release.

Download, Install & Test Apache-Win32

Visit http://www.apache.org/dyn/closer.cgi and download apache_1.3.X-win32-x86-no_src.msi where 'X' is 20 or higher. There are some issues with Apache 2, see TWiki:Codev.IssuesWithApache2dot0.

Using Windows 2003 IIs instead of Apache

First, Apache is much easier, but if you are already running IIs and don't want to run two servers, here are some IIs configuration steps.
  • Create a virtual directory with path Drive:\twiki
  • Add .pl extension c:\cygwin\bin\perl.exe -wT "%s" %s in the Application Configuration form.
  • Set the Execute permissions to Scripts only and check Scripts source access.
  • Now right click the bin directory and make it a virtual directory as well. It should inherit the previous settings.
  • Right click data, pub, and tmp and provide write access.
  • Make sure NTFS permissions are set correctly.
  • Web Service Extensions for CGI need to be allowed. Set All Unknown CGI Extensions to Allowed first to get everything working, then create an extension to be more specific (e.g. Add c:\cygwin\bin\perl.exe for the File Name).
  • Change all scripts to include the .pl extension and also change the invoke line to cygwin as below.
  • Now search and replace every setlib.cfg require command to include bin/ (e.g. require 'bin/setlib.cfg'). The reason for this step is that when invoking commands, IIs sets your current working directory to the top virtual directory instead of twiki/bin, so this was the only way I could get it to work. I did not have to do this with Apache.
  • Change LocalLib.cfg to include an absolute path to lib (e.g. e:/twiki/lib)
  • A mime type of .pl text/html was added, but I don't know if it is necessary.
  • Run configure.pl and correct all errors.

What may not work.

  • Trying to get Activestate and cygwin RCS to work. This requires additional Perl modifications.

Download, Install & Test Cygwin

ALERT! NOTE The following is out of date. You can no longer download perl 5.6 for Cygwin.

http://cygwin.com, and click the Install Cygwin Now link. Save the setup.exe in a directory, e.g. c:\download\cygwin-dist. Run the Cygwin setup.exe file - this will also install Perl and RCS in one fell swoop.

  • Choose Internet Install ; make sure default text file type is unix.; If you have the bandwidth and the drive space it is easier just to install everything ( Install All ).
  • The following packages are the minimal installation (~12mb): bash, binutils, diffutils, gcc, grep, gzip, make, nano, ncftp, pcre, perl (5.6.1-2 or higher, but not 5.8.0), rcs (5.7-2 or higher), tar, textutils, unzip, w32api, wget

Set the HOME environment variable to c:\cygwin\home\administrator through the Control Panel, System applet.

Fire up Cygwin and verify the version numbers are correct. RCS: 5.7, Perl: 5.6.1.

Configure cygwin for binary mode omitting this step leads to a partially working system that corrupts RCS files.

  • Configure: mount -b -s c:/twiki /twiki && mount -b -s c:/ /c && mount -b -c /cygdrive && mount
  • Test: cd /twiki && echo hi >t && cat -v t ;the output should be hi anything else indicates a problem.

Configure Apache

Edit c:/apache/conf/httpd.conf and adapt to local environment as necessary. Change

  • DocumentRoot from "C:/apache/htdocs" to "C:/twiki"
  • <Directory "C:/apache/htdocs"> to <Directory "C:/twiki">
  • Add:
<Directory  "C:/twiki/bin/">
    # Changing default None to All in next line, to enable .htaccess
    AllowOverride All
    Allow From All
    Options  ExecCGI
    SetHandler cgi-script

# Environment setup required to run Apache as service or as a
# standalone process.
<IfModule mod_env.c>
   # Adjust TZ for your server timezone, e.g. EST5EDT - put the non-daylight-savings
   # timezone code first (e.g. EST or GMT), followed by the number of hours that it's behind GMT 
   # during non-daylight-savings time (use '-5' for timezones in advance of GMT).
   SetEnv TZ GMT0BST
   SetEnv RCSINIT -x,v/
   # Adjust TEMP and TMP for your server and create directories if necessary
   SetEnv TEMP c:/temp
   SetEnv TMP c:/temp
   SetEnv LOGNAME system
   SetEnv HOME c:/twiki

Add an AddHandler line to the <IfModule mod_mime.c> section of httpd.conf - this removes the need to rename all the TWiki CGI scripts later in the installation. Note the trailing '.' on the AddHandler line.

# Document types
<IfModule mod_mime.c>
    # TWiki setup - avoid renaming scripts
    AddHandler cgi-script .

Install TWiki

Download the latest TWiki release and save it in the c:/twiki directory. Unzip in place.

Configure TWiki

Edit c:/twiki/lib/TWiki.cfg and adapt to local environment. Pay attention to the section "# variables that need to be changed when installing on a new server:". Example values (assumes cygwin-perl is being used. ActiveState users need a different syntax. Read the real cookbook for details,):

$wikiHomeUrl      = "http://yourdomain.com/bin/view";
$defaultUrlHost   = "http://yourdomain.com";
$scriptUrlPath    = "/bin";
$pubUrlPath       = "/pub";
$pubDir           = "/twiki/pub";
$templateDir      = "/twiki/templates";
$dataDir          = "/twiki/data";
$safeEnvPath      = "/bin";
$rcsDir           = "c:/cygwin/bin";
$egrepCmd         = "/bin/grep -E";
$fgrepCmd         = "/bin/grep -F";

Edit the CGI Scripts

You must use the Cygwin shell to do this (unless you are a Perl expert) - don't use the Windows command shell, cmd.exe (aka DOS Prompt). Change #!/usr/bin/perl -wT to #!c:/cygwin/bin/perl -wT . Example script to do this (explanation):

  • $ perl -pi~ -e 's;#!/usr/bin/perl;#!c:/cygwin/bin/perl;' *[a-z]

Perl module installation

From the Cygwin shell, type export TEMP=/c/temp (add it to ~/.profile ), then fire up cpan (will ask a schwack configuration questions if it hasn't been run before) and install Net::SMTP, Digest::SHA1, MIME::Base64

Re-lock RCS files

Go to http://yourdomain.com/bin/testenv - this provides a lot of detail, including warnings. Write down the Apache server's userid that is given by this script - typically either 'SYSTEM' or 'Administrator' - I'll assume 'SYSTEM' from now on.

  • backup all the twiki data files: cd /twiki/data && tar czvf all-files.tar.gz */*
  • Edit all the RCS files at once: perl -pi~~~ -e 'NR <= 10 && s/nobody:/system:/' */*,v

If something goes wrong: to restore your existing files from the backup, just type tar xzvf all-files.tar.gz and all your files, both .txt and .txt,v, will be back as they were before the edits.

After a few days of everything working well come back and delete the files which end with ~~~.

Email Setup

Set the SMTPMAILHOST variable in TWikiPreferences to an SMTP email host that is reachable and currently working. In the same place, you also want to change WIKIWEBMASTER and SMTPSENDERHOST.

Testing your TWiki Installation

  • testenv - use http://yourdomain.com/bin/testenv and check for warnings
  • Page viewing (view script) - click around a few pages and make sure the links are OK
  • RCS diffs (rdiff script) - click on the Diffs link and on the '>' links at bottom of page
  • Edit a page, and register as a new user - tests page creation, use of register script to create a new user entry in /twiki/data/.htpasswd (the Apache password file), ability to send email via Net::SMTP, and whether SMTPMAILHOST was set correctly in TWikiPreferences.
    • If you get a failure to register or send email, check the Apache error log, and that all CPAN modules were installed correctly in Step 6, Installing required Perl modules.
    • Try typing tail -30 /c/apache/logs/error_log to see last 30 errors from Apache
  • Edit a page - check revision increased and set to current date/time
  • Edit the same page using another browser or PC, logging in as a different user - check there's a lock message (which you can override) and no double lines
  • Check the Apache error_log file to see if there are any RCS errors so far
  • Index - tests whether ls and grep are working
  • Search - more tests for whether ls and grep are working
  • Attachments - tests access to /twiki/pub directory.

    • Try a binary attachment upload and check the number of bytes in the file has not changed - if it has, see the Install Cygwin section's note on the default text file type.
  • Check the Apache error_log file again

If anything doesn't work, go back and check the configuration of the Apache httpd.conf file, and TWiki.cfg. Have a look at the Apache error log, c:/apache/logs/error_log ,and the TWiki error log, /twiki/data/log*.txt ,and if necessary enable debugging on selected scripts (the commands are right at the top of each script) - the results go into /twiki/data/debug.txt .There is also a /twiki/data/warning.txt file that contains less serious messages.

-- Contributors: MattWilkie, RichardDonkin, PeterThoeny, SrinivasanBS, JeffDickson

Comments & Questions about this Supplemental Document Topic

fixed a minor formatting bug

-- MattWilkie - 21 Feb 2005

Hello...i'm trying to install twiki, but i can't do re-lock rcs files.. my user is projecto and files are locked to user nobody...i want to re-lock all rcs files but something is missing...help me!?

-- JoaquimFerreira - 02 Aug 2005

This section here is for feedback on the documentation. Please ask support questions in the Support web.

-- PeterThoeny - 02 Aug 2005

Added a note at the top and in the cygwin section that you can no longer download perl 5.6 for cygwin. Although I understand that Dakar will run on 5.8.

-- SamHasler - 20 Apr 2006

Added a section to help people trying to use IIs instead of Apache.

-- JeffDickson - 31 May 2007

Thanks Jeff!

-- PeterThoeny - 31 May 2007

I met the same problem as MattWilkie for re-lock rcs files. After I run all the command required for re-lock rcs files, the files is not changed at all.

-- JiaxinZhang - 01 Dec 2007

The instructions are very much out of date. For an easy to install TWiki on Windows see TWikiVMDebianStable. For personal use see TWikiForWindowsPersonal.

-- PeterThoeny - 01 Dec 2007

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r18 - 2012-02-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.