Running on TiddlyWeb, Part One
As I've just finished putting this site together, I thought I'd give you a brief overview of TiddlyWeb (the platform this site is built on) and how I went about implementing it.
First things first, there's quite a lot of documentation about TiddlyWeb already (see here) so I'm not going to explain the basics about it, or try to detail the underlying structure. All I'm going to do here is provide a set of instructions for installing and running TiddlyWeb on a setup similar to mine.
So what's my setup?
I'm running this site on Apache and Linux. I'm running Python through CGI, and I don't have root access to the server. If this sounds like you, then you've probably got one of the many hosting companies around providing you with your own web space on one of their servers. I would imagine this is a fairly common situation and unfortunately, requires jumping through a few extra hoops than the other install methods available, but here we go anyway.
The first hurdle to jump over is actually installing TiddlyWeb itself. Now, TiddlyWeb is usually installed with the Python tool "easy_install" but, if you don't have easy_install you're going to have to install it. The main problem with this however is the lack of root access. So to start, we're going to install Virtual Python. This is a tool that creates a virtual install of Python in your home directory and lets you install other libraries on top of that. So go here to install Virtual Python. Then go here and install easy_install from this script. From here, normal instructions can be followed for installation, so do:
Now that TiddlyWeb's installed, we need to create an instance in the directory you publish websties in (most likely public_html). So, go into this directory and run:
Where <instance_name> is the name you want to give your wiki. This will then set things up for a default install, creating the store (where your content is stored) and creating a default config file called "tiddlywebconfig.py". However, we don't want a default install, so go and grab the index.cgi file from the svn repository and drop it in the root of your web directory (e.g. public_html). Now open it up in a text editor (vi, nano, etc) and do the following:
Change the path at the top of the file to be your virtual python install path
then set the following:
Then check that the following lines are either commented out or do not exist (note that these changes may be implemented in a future version of TiddlyWeb, thus saving you the bother):
and finally make sure the line
looks more like this:
That's it for now, so save and quit and load up tiddlywebconfig.py in a text editor. Add the following lines:
Save and quit. That should be it, TiddlyWeb should now work. Open up your browser and point it to http://your_domain_name/<instance_name/index.cgi/ to browse through bags, recipes, etc. Note that you will need the forward slash after the index.cgi, or you'll probably get an error.
Coming in Part 2 - Configuration and finalisation
The index.cgi file has now changed. Please see CGI Install Update for more information.
First things first, there's quite a lot of documentation about TiddlyWeb already (see here) so I'm not going to explain the basics about it, or try to detail the underlying structure. All I'm going to do here is provide a set of instructions for installing and running TiddlyWeb on a setup similar to mine.
So what's my setup?
I'm running this site on Apache and Linux. I'm running Python through CGI, and I don't have root access to the server. If this sounds like you, then you've probably got one of the many hosting companies around providing you with your own web space on one of their servers. I would imagine this is a fairly common situation and unfortunately, requires jumping through a few extra hoops than the other install methods available, but here we go anyway.
Step One: Installing TiddlyWeb
The first hurdle to jump over is actually installing TiddlyWeb itself. Now, TiddlyWeb is usually installed with the Python tool "easy_install" but, if you don't have easy_install you're going to have to install it. The main problem with this however is the lack of root access. So to start, we're going to install Virtual Python. This is a tool that creates a virtual install of Python in your home directory and lets you install other libraries on top of that. So go here to install Virtual Python. Then go here and install easy_install from this script. From here, normal instructions can be followed for installation, so do:
easy_install -U tiddlyweb
Step Two: Setting up an Instance
Now that TiddlyWeb's installed, we need to create an instance in the directory you publish websties in (most likely public_html). So, go into this directory and run:
twanager instance <instance_name>
Where <instance_name> is the name you want to give your wiki. This will then set things up for a default install, creating the store (where your content is stored) and creating a default config file called "tiddlywebconfig.py". However, we don't want a default install, so go and grab the index.cgi file from the svn repository and drop it in the root of your web directory (e.g. public_html). Now open it up in a text editor (vi, nano, etc) and do the following:
Change the path at the top of the file to be your virtual python install path
then set the following:
file_store_location = <path_to_your_store>
//most likely <instance_name>/store
//most likely <instance_name>/store
Then check that the following lines are either commented out or do not exist (note that these changes may be implemented in a future version of TiddlyWeb, thus saving you the bother):
#sys.path.append('/home/cdent/src/TiddlyWeb')
#web_server_base = '/tiddlyweb/index.cgi'
# hostname = os.environ['HTTP_HOST']
# if ':' in hostname:
# hostname, port = hostname.split(':')
# config['server_prefix'] = web_server_base
#web_server_base = '/tiddlyweb/index.cgi'
# hostname = os.environ['HTTP_HOST']
# if ':' in hostname:
# hostname, port = hostname.split(':')
# config['server_prefix'] = web_server_base
and finally make sure the line
app = serve.load_app(hostname, port, config['urls_map'])
looks more like this:
app = serve.load_app()
That's it for now, so save and quit and load up tiddlywebconfig.py in a text editor. Add the following lines:
'server_prefix': '<instance_name>/index.cgi',
'server_host': {
'scheme': 'http',
'host': '<domain_name>',
'port': '80',
},
'server_host': {
'scheme': 'http',
'host': '<domain_name>',
'port': '80',
},
Save and quit. That should be it, TiddlyWeb should now work. Open up your browser and point it to http://your_domain_name/<instance_name/index.cgi/ to browse through bags, recipes, etc. Note that you will need the forward slash after the index.cgi, or you'll probably get an error.
Coming in Part 2 - Configuration and finalisation
Update
The index.cgi file has now changed. Please see CGI Install Update for more information.
Comments