Title: Step-by-Step Instruction for Installation of TiddlyWeb in
Windows Client-Server Environment
Subtitle: Bridging between Open Source and Commercial Software World
Author: Yang Li, BT Research & Technology (
http://research.bt.com/is/
YangLi.html)
Contents
Step 1 Installation of Apache HTTP Server
Step 2 Installation of Python
Step 3 Installation of mod_wsgi
Step 4 Installation of Setup Tools
Step 5 Installation of TiddlyWeb Packages
Step 6 Creation of TiddlyWeb Instance
Step 7 Mounting TiddlyWeb onto Apache HTTP Server
Step 8 Testing TiddlyWeb from Local Client
Step 9 Testing TiddlyWeb from Remote Client
Acknowledgements
Document History
Executive summary
TiddlyWeb is an extension of TiddlyWiki in the web environment. There
are many applications that have been and are being built on top of the
TiddlyWeb platform. As part of an open source software family,
TiddlyWeb has spawned a sizeable user community, most of them are
using Unix-family systems and tools. Whilst there do exist
instructions and tips related to the installation of TiddlyWeb in
Windows environment, these often appear to be random, lacking of a
consistent and continuous account of installation flow. Furthermore,
such instructions are often limited to local host, whereas a proper
setting-up and use of TiddlyWeb often involves separated domains of
clients and servers. This tutorial sets out to describe detailed
instructions of installing TiddlyWeb in a cross-domain, client-server
Windows environment. It aims to bridge between open source and
commercial software communities, and targets at those who are new to
TiddlyWeb, open source and Wndows.
The following sections describe the installation steps of TiddlyWeb.
In each step, it describes where to find sources, how to install it
and how to verify the success of installation. It is based on a real
case study in which the author was approached to help install and roll
out TiddlyWeb application in his business unit at BT. The server
machine has Windows 2003 Enterprise Edition installed and the client
machine uses Windows XP.
Step 1 Installation of Apache HTTP Server
Search for “Apache HTTP Server Download” in Google, or visit
http://httd.apache.org/download.cgi.
Choose Apache 2.2 and install it on Windows Server as a Windows
service. Apache 2.2 is now installed under “E\Program Files\Apache
Software Foundation\http server 2.2”. You can choose a different
installation directory, but in this example we use this directory.
To verify, click “Start”->”Administrative Tools”->”Services”, and
search for the line starting with “Apache2.2”. If you can find it,
then the installation of Apache HTTP server has been successful.
Step 2 Installation of Python
Search for “Python 2.6 download” in Google, or visit
http://www.python.org/download/releases/2.6.4/
Choose Python 2.6 and install it on Windows Server. Python 2.6 is now
installed under “E:\Python26”. You can choose a different installation
directory, but in this example we use this directory.
In “Start”->”Control Panel”->”System”->”Advanced”->”Environment
Variables”->”System Variables”, select “PATH” and edit it by adding “E
\Python26;” to the front of PATH.
To verify, open a “Command Prompt” window, and type in “python”. If
you can see Python command line, then the installation of Python is
successful.
Step 3 Installation of mod_wsgi
Search for “mod_wsgi-2.6” in Google, or visit
http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py26-2.6.so
Download
mod_wsgi-win32-ap22py26-2.6.so, rename it to “mod_wsgi.so”,
and copy it into directory “E:\Program Files\Apache Software Foundation
\http server 2.2\modules” on Windows Server.
Open “httpd.config” file in directory “E:\Program Files\Apache
Software Foundation\http server 2.2\conf”, and include this line
“LoadModule wsgi_module modules/mod_wsgi.so” in the section “Dynamic
Shared Object (DSO) Support”.
To verify, restart Apache HTTP Server in Windows Services, and open
Apache HTTP Server Error Log File (“E:\Program Files\Apache Software
Foundation\http server 2.2\logs\error.log). If you find such a message
line “Apache/2.2.14 (win32) mod_wsgi/2.6 Python/2.6.4 configured”,
then the installation of mod_wsgi is successful.
Step 4 Installation of Setup Tools
Search for “setuptools-0.6c11.win32-py2.6.exe” in Google, or visit
http://pypi.python.org/pypi/setuptools#files.
Download setuptools-0.6c11.win32-py2.6.exe, and install it on Windows
Server.
In “Start”->”Control Panel”->”System”->”Advanced”->”Environment
Variables”->”System Variables”, select “PATH” and edit it by adding “E:
\Python26\Scripts;” to the front of PATH.
To verify, move to directory “E:\Python26\Scripts” and look for
“easy_install.exe”. If you can find it, then the installation of setup
tools is successful.
Step 5 Installation of TiddlyWeb Packages
Visit
http://pypi.python.org/pypi, and manually search (you may only
type in package name and ignore version in the search box) and
download the following packages:
BeautifulSoup-3.1.0.1-py2.5
CherryPy-3.1.2-py2.5
WikklyText-1.6.0-py2.5
boodebr-1.5.0-py2.5
html5lib-0.11.1-py2.5
ply-3.3-py2.5
resolver-0.2.1-py2.5
selector-0.8.11-py2.5
setuptools-0.6c9-py2.5
simplejson-2.0.9-py2.5
tiddlyweb-0.9.75-py2.5
tiddlywebplugins
tiddlywebplugins.status-0.3-py2.5
tiddlywebplugins.wikklytextrender-0.3-py2.5
tiddlywebwiki-0.12.1-py2.5
wikklytext
wsgifront-0.9.9-py2.5
Manually install each of the packages on Windows Server using the
following commands (type them in “Command Prompt” window):
cd package-directory
python setup.py install
During the installation, if there are error messages that indicate
dependency violations, you can try to install the depended packages
first and then install the depending packages, until all the packages
are successfully installed.
To verify, move into directory “E:\Python26\Lib\site-packages” and
look for .egg for the above-mentioned packages. If you can find them
all, then the installation of TiddlyWeb packages are successful.
Step 6 Creation of TiddlyWeb Instance
On Windows Server, open a “Command Prompt” window and type in this
command:
python e:\Python26\Scripts\twinstance e:\Python26\TiddlyWebInstances
\research
A new TiddlyWeb instance called “research” is then created under
directory “e:\Python26\TiddlyWebInstances”.
To verify, move into “research” and view its contents. If you find a
folder “store” and a file “tiddlywebconfig.py”, then the creation of
TiddlyWeb instance has been successful.
Step 7 Mounting TiddlyWeb onto Apache HTTP Server
On Windows Server, open “httpd.config” file in directory “E:\Program
Files\Apache Software Foundation\http server 2.2\conf”.
Firstly, locate the section on “”Listen”. Replace “Listen 80” with
“Listen 888”.
Secondly, locate the section on “virtual hosts”. Insert the following
directive into this section:
<VirtualHost *:888>
ServerName localhost
ServerAlias localhost
ServerAdmin staff@localhost
# WSGIDaemonProcess localhost user=daemon processes=2 threads=15
# WSGIProcessGroup localhost
<Directory E:\Python26\TiddlyWebInstances\research>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias / E:\Python26\TiddlyWebInstances\research\apache.py
</VirtualHost>
Next, open tiddlywebconfig.py in directory “E:
\Python26\TiddlyWebInstances\research”. Insert the following directive
into tiddlywebconfig.py. Please use 4-space indentation instead of
tab.
,
'server_host': {
'scheme': 'http',
'host': 'localhost',
'port': '888'
}
Next, create an empty file named “apache.py” in directory “E:
\Python26\TiddlyWebInstances\research”. Open
http://github.com/tiddlyweb/tiddlyweb/raw/master/apache.py in a web
browser and copy & paste its content into apache.py, and save it.
Finally, re-start Apache HTTP server on Wndows Server.
To verify the final installation of TiddlyWeb, you need to take Step 8
to test it from a local client and Step 9 from a remote client.
Step 8 Testing TiddlyWeb from Local Client
On Windows Server, open this link
http://localhost:888/recipes/default/tiddlers.wiki
via Internet Explorer. If you find no error message, the installation
of TiddlyWeb is successfully tested from a local client.
Step 9 Testing TiddlyWeb from Remote Client
On a remote client machine (in this example, a laptop installed with
Windows XP), open this link
http://132.146.212.41:888/recipes/default/tiddlers.wiki
via Internet Explorer. If you find no error message, then the
installation of TiddlyWeb is successfully tested from a remote client
machine.
If there is an error message that says “Error: Permission denied to
call method XMLHttpRequest.open”, do the following configuration in
Internet Explorer: "Tools"->"Internet Options"->"Security"->"Local
intranet"->"Sites"->"Advanced"->"Add this Web site to the zone:", type
"132.146.212.41" and click "Add" and "OK"s to confirm.
On the remote client machine, re-load the page
http://132.146.212.41:888/recipes/default/tiddlers.wiki via Internet
Explorer. If you find no error message, then the installation of
TiddlyWeb is successfully tested from a remote client machine.
Acknowledgements
The author wishes to acknowledge helps from OSMOSOFT team for sharing
knowledge and experience with TiddlyWeb. In particular, I would like
to thank Jeremy Ruston for hosting my day-trip to his team in St
James’s Park, Ben Gillies and Jon Robson for sharing their hand-on
experience of TiddlyWeb in Linux. There are also plenty of online
tutorial materials authored by numerous TiddlyWeb gurus, led by Chris
Dent, which also proved very helpful to me in this exercise.