<<O>> Difference Topic WindowsInstallCookbook (r1.4 - 03 Mar 2003 - PeterThoeny) |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Windows Install Cookbook | ||||||||
Line: 40 to 40 | ||||||||
Scope | ||||||||
Changed: | ||||||||
< < |
This document covers installation of the TWiki -1-Feb-2003 production release in the following environment - if you want to use a different environment, feel free to use this as a guideline only. | |||||||
> > |
This document covers installation of the TWiki 01-Feb-2003 production release (TWiki:Codev/TWikiRelease01Feb2003) in the following environment - if you want to use a different environment, feel free to use this as a guideline only. (It has been mainly tested with the TWiki 01-Dec-2001 release but should work fine with Feb 2003.) | |||||||
| ||||||||
Line: 457 to 457 | ||||||||
5. Minor changes to TWiki scripts | ||||||||
Changed: | ||||||||
< < |
As an interlude, you now need to make some minor edits to files in the c:/twiki/bin directory, using a suitable editor (remember to use nano -w filename if you prefer nano to vi - or just use the Windows PFE editor).
| |||||||
> > |
TWiki Dec 2001 release only - fixed in Feb 2003 release
If using the Dec 2001 release, you now need to make some minor edits to files in the c:/twiki/bin directory, using a suitable editor (remember to use nano -w filename if you prefer nano to vi - or just use the Windows PFE editor).
| |||||||
| ||||||||
Line: 582 to 584 | ||||||||
8. Email setup for notification and registration | ||||||||
Changed: | ||||||||
< < |
You need to set the SMTPMAILHOST to an SMTP email host that is reachable and currently working. Otherwise you'll get a confusing message from TWiki when registering new users or running mailnotify (for WebNotify), along the lines of:
| |||||||
> > |
You need to set the SMTPMAILHOST in TWikiPreferences to an SMTP email host that is reachable and currently working. Otherwise you'll get a confusing message from TWiki when registering new users or running mailnotify (for WebNotify), along the lines of:
| |||||||
Software Error: Can't call method "mail" on an undefined value at ../lib/TWiki/Net.pm line 187. | ||||||||
Line: 658 to 660 | ||||||||
People who've tested or reviewed this document and provided valuable feedback include: | ||||||||
Added: | ||||||||
> > |
||||||||
<<O>> Difference Topic WindowsInstallCookbook (r1.3 - 02 Feb 2003 - PeterThoeny) |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Windows Install Cookbook | ||||||||
Line: 40 to 40 | ||||||||
Scope | ||||||||
Changed: | ||||||||
< < |
This document covers installation of the TWiki Dec 2001 release in the following environment - if you want to use a different environment, feel free to use this as a guideline only. | |||||||
> > |
This document covers installation of the TWiki -1-Feb-2003 production release in the following environment - if you want to use a different environment, feel free to use this as a guideline only. | |||||||
| ||||||||
Line: 241 to 241 | ||||||||
7. Download TWiki | ||||||||
Changed: | ||||||||
< < |
Download the latest TWiki release (this cookbook is tested with the Dec 2001 release) from the URL that PeterThoeny sent you, and save it in the c:/twiki directory.
| |||||||
> > |
Download the latest TWiki release from the URL that PeterThoeny sent you, and save it in the c:/twiki directory.
| |||||||
8. Install TWiki |
<<O>> Difference Topic WindowsInstallCookbook (r1.2 - 01 Feb 2003 - PeterThoeny) |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Windows Install Cookbook | ||||||||
Line: 576 to 576 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
You have now re-locked all the RCS files and are ready to start using TWiki! Of course, testing that it works is always a good idea, so that's next. | |||||||
> > |
You have now re-locked all the RCS files and are almost ready to start using TWiki! | |||||||
Email setup | ||||||||
Line: 593 to 592 | ||||||||
Testing your TWiki installation | ||||||||
Changed: | ||||||||
< < |
Do try and exercise your TWiki in test mode before you release it to other users or put any significant data into it. | |||||||
> > |
It is important to test your TWiki installation before you release it to other users or put any significant data into it. | |||||||
Here are the main things to test: |
<<O>> Difference Topic WindowsInstallCookbook (r1.1 - 30 Jan 2003 - PeterThoeny) |
Line: 1 to 1 | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | ||||||||||||||||||||||
> > |
Windows Install CookbookIntroductionThis cookbook is intended to get you up and running with TWiki on Windows quickly, with as few problems as possible. The 'cookbook' approach is simply to restrict the many choices that someone installing TWiki must make, so that a reasonably well-defined procedure can be followed - new users can simply follow the steps, while experts can use this as more of a guideline. Please read TWiki:Codev.WindowsModPerlInstallCookbook in case you use mod_perl. There is a huge volume of existing material on TWiki about installing on Windows, and I'm indebted to the many contributors for this - the aim of this cookbook is to synthesise the many tips into a recipe that works.
Recent updates
ScopeThis document covers installation of the TWiki Dec 2001 release in the following environment - if you want to use a different environment, feel free to use this as a guideline only.
AlternativesThere are doubtless other combinations of components that may work - in particular:
Checking versionsIf you already have some of these add-ons installed, here's how to check the versions - this assumes you have TWiki:Codev.CygWin already installed:$ : Cygwin DLL version is the number in 1.3.x format $ uname -r $ less c:/your-apache-dir/Announcement $ perl -v $ rcs -VIf you have an older version of any component, do yourself a favour and upgrade it as part of the install process. Pre-requisites and upgradesYou will need to have local administrator rights and to be comfortable with Windows administration. This cookbook is intended for a clean install, i.e. none of these components are already installed. However, since Cygwin and Apache's installation process is fairly upgrade-friendly, upgrades should work as well - take backups of all your data and config files first, though!Text editingEditing Cygwin files is best done with an editor that can handle Unix file format (see the Cygwin binary mode section below) - the installation process includesnano , a non-GUI editor, but if you prefer to use a GUI editor, you should first install PFE, a freeware editor that supports Unix format files. PFE is available on download.com and Simtel.
Another good TWiki:Codev.OpenSource editor is SciTE (aka WSciTE), available at http://www.scintilla.org/SciTE.html.
The Unix/Windows EnvironmentIt's a little known fact that you can use pathnames such asc:/apache almost everywhere in Windows - try it in a File Open dialogue box. The main exception is the Win2000 cmd.exe command line shell - here, you must use double quotes around forward slashes, e.g. dir "c:/apache" will work fine.
The reason this matters is that '\' is a special character to Perl and other tools, so it's much easier to use '/' everywhere.
The Cygwin environmentTWiki:Codev.CygWin is a Unix-like environment for Windows - many of its tools support thec:/apache format, but it also provides a more Unixlike syntax, e.g. /usr/bin/rcs.exe , because some Unix tools ported onto Cygwin only support the Unix format.
When you launch a Cygwin shell, your existing PATH variable is translated from the Windows format to the Unix format, and the ';' separators in the Windows PATH are changed into ':' separators as required by Unix. A Cygwin tool (e.g. Cygwin Perl or Cygwin RCS) will always use the Unix PATH format, and will accept Unix format pathnames.
The Apache environmentApache runs as a native Windows process and has nothing to do with Cygwin (at least the version used in this cookbook doesn't). Hence it supports c:/ pathnames in its config files and the first line of Perl CGI scripts. If you need to use spaces in file names (not recommended), put double quotes around the file name in thehttpd.conf file. There have been some security-related bugs in Apache with long pathnames, which are a bit more likely if you use spaces, so it's best to just avoid long names and using spaces.
The Perl environmentOnce Perl has been launched by Apache, it is in Cygwin mode, and so is everything it launches, includingls , egrep , and RCS tools that it (typically) launches with the bash shell.
If you need to use spaces in file names (not recommended), you may be able to put double quotes around the file name in the TWiki.cfg file - however, it's not clear whether all the TWiki code would work with this.
Installing ComponentsEnough background, let's get on with the installation.TWiki (part 1)Head to http://twiki.org, click the download link, and fill in the form to request a URL for download. You'll get an automated email, which should arrive by the time you need it.Apache1. Download Apache
apache -k stop .
Cygwin, Unix tools, Perl and RCS4. Install Cygwin Head to http://cygwin.com, and click the Install Cygwin Now link. Save thesetup.exe in a directory, e.g. c:\download\cygwin-dist .
Now run the Cygwin setup.exe file - this will also install Perl and RCS in one fell swoop.
$ mkdir /twiki /c c:/twiki $ mount -b -s c:/twiki /twiki $ mount -b -s c:/ /c $ mount -b -c /cygdrive $ mount Device Directory Type Flags C:\cygwin\bin /usr/bin system binmode C:\cygwin\lib /usr/lib system binmode C:\cygwin / system binmode c:\twiki /twiki system binmode c: /c system binmode
.profile file. For more information on binary vs text mode, see this User Guide section and this FAQ entry.
TWiki (part 2)7. Download TWiki Download the latest TWiki release (this cookbook is tested with theDec 2001 release) from the URL that PeterThoeny sent you, and save it in the c:/twiki directory.
8. Install TWiki
Unzip the ZIP file under c:/twiki using WinZip, or by going into Cygwin and doing the following - you can hit the TAB key to complete filenames after you've typed the first part:
$ cd /twiki $ unzip TWiki20011201.zip Configuring componentsNow that all the components are installed, you need to configure them.Configuring ApacheThe setup given here is fairly simple, in that it allows only TWiki to be served by the web server. For more complex setups, you can investigate the Alias and ScriptAlias commands that are left commented out in this configuration.
'nano' , or the Windows PFE editor, unless you already know 'vi' ), edit c:/apache/conf/httpd.conf as follows - this tells Apache where TWiki lives, and removes the need to tinker with the Windows 2000 environment settings.
# Change this to point to the Apache administrator (e.g. you) ServerAdmin you@yourdomain.com # Replaces DocumentRoot "C:/apache/htdocs" DocumentRoot "C:/twiki" # Replaces <Directory "C:/apache/htdocs"> <Directory "C:/twiki">
# Alias /twiki/ "C:/twiki/" # ScriptAlias /twiki/bin/ "C:/twiki/bin/" <Directory "C:/twiki/bin/"> # RD: Changed None to All in next line, to enable .htaccess AllowOverride All Allow From All Options ExecCGI SetHandler cgi-script </Directory> # 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 </IfModule>2. Configure Apache (part 2) 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.
# # Document types # <IfModule mod_mime.c> # TWiki setup - avoid renaming scripts AddHandler cgi-script . </IfModule> Configuring TWiki3. Configure TWiki Edit the TWiki config file,c:/twiki/lib/TWiki.cfg (or in Cygwin terms, /twiki/lib/TWiki.cfg ) as follows:
# variables that need to be changed when installing on a new server: # ================================================================== # http://your.domain.com/twiki : link of TWiki icon in upper left corner : $wikiHomeUrl = "http://yourdomain.com/bin/view"; # Host of TWiki URL : (Example "http://myhost.com:123") $defaultUrlHost = "http://yourdomain.com"; # /cgi-bin : cgi-bin path of TWiki URL: $scriptUrlPath = "/bin"; # /pub : Public data path of TWiki URL (root of attachments) : $pubUrlPath = "/pub"; # NOTE: Next three settings should be valid absolute pathnames using Cygwin; if using # TWiki:Codev.ActiveState Perl, use z:/twiki format pathnames if your TWiki directory is not on C:. # Public data directory, must match $pubUrlPath : $pubDir = "/twiki/pub"; # Template directory : $templateDir = "/twiki/templates"; # Data (topic files) root directory : $dataDir = "/twiki/data"; .... # Set ENV{'PATH'} explicitly for taint checks ( #!perl -T option ) : # (Note: PATH environment variable is not changed if set to "") # On Windows, $safeEnvPath needs only one component, the directory where RCS is installed # - used by 'rcsdiff' to run 'co' program, so PATH must be correct. # Unix/Linux setting: # $safeEnvPath = "/bin:/usr/bin"; # Using Cygwin perl, so can use Unix-like paths, with ':' as separator. # Note that /usr/bin and /bin are identical due to default /usr/bin mount # in Cygwin. Must NOT use 'c:/foo' type paths, as ':' is taken as separator # meaning that 'c' is interpreted as a pathname, giving Perl taint error. $safeEnvPath = "/bin"; # If using ActiveState perl, use Windows paths instead # $safeEnvPath = "c:/cygwin/bin"; ... # RCS directory (find out by 'which rcs') : $rcsDir = "c:/cygwin/bin"; ... # Unix egrep command : $egrepCmd = "/bin/grep -E"; # Unix fgrep command : $fgrepCmd = "/bin/grep -F";For the cookbook install using Cygwin Perl, there's no more TWiki.cfg editing to be done, so you can get onto the next section.
# NOTE: When using ActiveState Perl, you must specify # a full Windows-style pathname, using '\\' for backslashes, # for the ls, egrep and fgrep commands, because Cygwin's shell # is not used - forward slashes are OK in Windows everywhere # except in the cmd.exe shell. Drive letters are OK - e.g. # 'c:\\foo\\ls' will work. When using Cygwin perl, just # use the default '/bin/ls' type settings. # # Unix ls command : $lsCmd = "c:\\cygwin\\bin\\ls"; # Unix egrep command : $egrepCmd = "c:\\cygwin\\bin\\grep"; # Unix fgrep command : $fgrepCmd = "c:\\cygwin\\bin\\grep"; Editing the CGI scripts4. Editing the Shebang lines Now to edit the curiously named 'shebang lines' at the top of the TWiki CGI scripts...
$ cd /twiki/bin $ ls attach geturl oops rdiff save testenv viewfile changes installpasswd passwd register search upload edit mailnotify preview rename statistics view $ mkdir .backup $ cp * .backup $ head -1 view #!/usr/bin/perl -wT $ perl -pi~ -e 's;#!/usr/bin/perl;#!c:/cygwin/bin/perl;' *[a-z] $ head -1 view #!c:/cygwin/bin/perl -wT $ ls attach geturl oops rdiff save testenv viewfile~ attach~ geturl~ oops~ rdiff~ save~ testenv~ view~ changes installpasswd passwd register search upload changes~ installpasswd~ passwd~ register~ search~ upload~ edit mailnotify preview rename statistics view edit~ mailnotify~ preview~ rename~ statistics~ viewfileIf for some reason the edit goes wrong, just type cp .backup/* . (while within the bin directory) to restore the original distribution files. Use ls -a to see the .backup directory, and ls -a .backup to view its contents.
Optional step: you can do 'rm *~' to clean out the backups made by Perl, but that's not essential as all the original files cannot be executed. If you do this, type the command very carefully, as a space after the '*' will wipe out all files in this directory!
5. Minor changes to TWiki scripts
As an interlude, you now need to make some minor edits to files in the c:/twiki/bin directory, using a suitable editor (remember to use nano -w filename if you prefer nano to vi - or just use the Windows PFE editor).
return $user . ':{SHA}' . MIME::Base64::encode_base64(Digest::SHA1::sha1($passwd));
Perl module installation6. Installing required Perl modules Some additional Perl modules are needed for theregister script to work properly. Fortunately, there is an automated tool that makes it easy to do this - it's called cpan , and goes to the Perl module archive site, http://www.cpan.org/, to download all required modules, and then build and install them. Here's what you need to do:
First of all, you need to get the cpan tool configured and working - this is only necessary once. From the Cygwin shell, type the following (putting the export command in ~/.profile is recommended to make this setting persistent). Without the TEMP variable, some modules may fail to install on Windows 2000 and higher.
$ export TEMP=/c/temp $ cpan Lots of questions about configuration and preferences - just hit Enter until you get to the questions about mirror sites, but answer the questions about FTP proxies etc if you are behind a proxy-based firewall. The CPAN tool will fetch a series of files, some quite large, as part of this setup process, so be patient...NOTE: If you are behind a non-proxy-based firewall that requires the use of passive FTP, the initial downloads of files using Net::FTP may appear to hang - just wait 5 or more minutes, however, and the CPAN tool should eventually hit on ncftpget , which is part of Cygwin and does work OK. If this doesn't work and you are behind a typical NAT-based firewall, try doing the following at the Cygwin shell before running cpan - this forces Net::FTP to use passive FTP, letting it get through such firewalls:
$ export FTP_PASSIVE=1If this works, add this line to your ~/.profile file for future use.
Once some initial files are downloaded, you are asked to select your continent and country, and then mirror sites - just type the number of the mirror sites you want to use (pick a few in case one is down):
... (28) Turkey (29) Ukraine (30) United Kingdom Select your country (or several nearby countries) [] 30 (1) ftp://cpan.teleglobe.net/pub/CPAN (2) ftp://ftp.clockerz.net/pub/CPAN/ (3) ftp://ftp.demon.co.uk/pub/CPAN/ (4) ftp://ftp.flirble.org/pub/languages/perl/CPAN/ (5) ftp://ftp.mirror.ac.uk/sites/ftp.funet.fi/pub/languages/perl/CPAN/ (6) ftp://ftp.plig.org/pub/CPAN/ (7) ftp://mirror.uklinux.net/pub/CPAN/ (8) ftp://sunsite.doc.ic.ac.uk/packages/CPAN/ (9) ftp://usit.shef.ac.uk/pub/packages/CPAN/ Select as many URLs as you like, put them on one line, separated by blanks [] 4 7 8 Enter another URL or RETURN to quit: [] New set of picks: ftp://ftp.flirble.org/pub/languages/perl/CPAN/ ftp://mirror.uklinux.net/pub/CPAN/ ftp://sunsite.doc.ic.ac.uk/packages/CPAN/Eventually, you'll get to the CPAN tool's shell prompt, where you need to install a few modules - the tool will do all the work for you.
cpan shell -- CPAN exploration and modules installation (v1.59_54) cpan> install Net::SMTP May already be installed - if it is, try 'force install', since it's useful to be able to set firewall and passive FTP configuration when using Net::FTP. Make sure you answer 'Y' to the question about whether you want to configure this package. cpan> install Digest::SHA1 Lots of output about how CPAN finds, builds and installs the module - watch for any errors, though it should work fine if you have installed the Cygwin packages listed above (particularly 'gcc' and 'make'). cpan> install MIME::Base64 May already be installed. Re-locking RCS files7. Re-locking files First, some testing: in your browser, 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.
rcs -u and rcs -l , but it's a painfully manual process. Instead, just use Perl again to mass-edit all the RCS files, as follows:
$ cd /twiki/data $ : Make a backup of all files $ tar czvf all-files.tar.gz */* $ : Test edit a single file to check your typing $ perl -pi~~~ -e 'NR <= 10 && s/nobody:/system:/ ' Main/WebIndex.txt,v $ diff Main/WebIndex.txt,v Main/WebIndex.txt,v~~~ 5c5 < system:1.2; strict; --- > nobody:1.2; strict; $ : Now edit all the RCS files at once - use cursor-up to recall previous command $ perl -pi~~~ -e 'NR <= 10 && s/nobody:/system:/ ' */*,v $ : Check for any remaining files not edited $ grep 'strict;$' */*,v | grep -v system $ : Clean up - type this very carefully $ rm */*~~~
Email setup8. Email setup for notification and registration You need to set theSMTPMAILHOST to an SMTP email host that is reachable and currently working. Otherwise you'll get a confusing message from TWiki when registering new users or running mailnotify (for WebNotify), along the lines of:
Software Error: Can't call method "mail" on an undefined value at ../lib/TWiki/Net.pm line 187.There are other settings to be made in TWikiPreferences, e.g. the WIKIWEBMASTER and (probably) the SMTPSENDERHOST (normally your mail server or TWiki server). See the TWikiInstallationGuide for more details, what's listed here is just enough to let you run the basic tests.
Testing your TWiki installationDo try and exercise your TWiki in test mode before you release it to other users or put any significant data into it. Here are the main things to test:
TroubleshootingIf anything doesn't work, go back and check the configuration of the Apachehttpd.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.
See TWiki:Codev.TWikiPatches in case there are patches (i.e. specific code changes) for particular problems that may affect you (e.g. TWiki:Codev.ChangePasswordOnWin2K).
If you find that the Index feature doesn't work, or topic name searches fail, you should check you have set $egrepCmd and $fgrepCmd correctly, as mentioned above.
PermissionsTWiki:Codev.CygWin has several models for how it does security:
Next StepsSee the TWikiInstallationGuide for other setup. In particular, you'll probably want to refer to the section on basic authentication - remember to usec:/twiki type filenames (i.e. Windows format) since you are using Apache for Windows.
Improved authenticationYou may want to investigate TWiki:Codev.WindowsInstallModNTLM, which describes how to add an Apache module so that TWiki:Codev.InternetExplorer users are automatically authenticated based on their Windows domain login - this avoids TWiki:Codev.GettingTheUsernameWrong and TWiki:Codev.ForgettingPasswords, which are usually very common among TWiki users.Improved performanceSee TWiki:Codev.WindowsModPerlInstallCookbook and TWiki:Codev.ModPerl for information on installing TWiki under Apache'smod_perl - this is somewhat more complex and follows a different model, so it's best to get some experience with TWiki, Apache and Perl first.
Format of filenamesIn your TWiki on Windows installation, it's worth remembering that:
CreditsMaterial in this cookbook is heavily based on the enormous number of contributions in TWiki:Codev.TWikiOnWindowsArchive and related topics - too many people to thank, but have a look at the contributor list to TWiki:Codev.TWikiOnWindowsArchive to get an idea! People who've tested or reviewed this document and provided valuable feedback include:
Comments welcome at TWiki:Codev.WindowsInstallCookbookComments -- PeterThoeny - 30 Jan 2003 |
Topic WindowsInstallCookbook . { View | Diffs | r1.4 | > | r1.3 | > | r1.2 | More } |
Revision r1.1 - 30 Jan 2003 - 09:17 - PeterThoeny Revision r1.4 - 03 Mar 2003 - 01:16 - PeterThoeny |
Copyright © 1999-2024 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding TWiki.Tukro? Send feedback. |