bengillies.net

a blog by Ben Gillies

CGI and TiddlyWeb 1.0

Now that TiddlyWeb has hit the 1.0 milestone, I figured it was about time to blog the latest and greatest way to get it running using cgi. I've simplified the instructions somewhat so that, apart from editing a few config files, and changing the paths to your specific paths, you should be able to copy/paste most of it.

Just one final note before we get going, these instructions are for Linux/*nix systems only, so they should work on most versions of Linux, Mac OSX, BSD, etc. If you are using a Windows system, you probably want the Installing TiddlyWeb on Windows instructions.

Installation


Download virtualenv-x.x.x.tar.gz (replace x.x.x with the latest version number) from http://pypi.python.org/pypi/virtualenv and put it into your home directory. Then, from you home directory, do the following:
tar -xvzf virtualenv-x.x.x.tar.gz
cp virtualenv-x.x.x/virtualenv.py ~
python virtualenv.py ~
source bin/activate
easy_install -U pip
pip install -U virtualenv
pip install -U tiddlywebwiki
twinstance <instance_name>
mkdir .python-eggs
mkdir twconfig
mv <instance_name>/tiddlywebconfig.py twconfig/tiddlywebconfig.py
touch twconfig/tiddlyweb.log
wget http://github.com/tiddlyweb/tiddlyweb/raw/master/index.cgi
chmod +x index.cgi
mv index.cgi public_html/cgi-bin/


Configuration


Nano is a simple text editor that you can use to make some changes to index.cgi. Feel free to use whatever you like, though bear in mind that nano is probably the easiest to start off with.
cd public_html/cgi-bin
nano index.cgi

So, change the line at the top to point to your local version of python (type in "which python" to find this out). It should end up similar to the following:
#!/home/bengillies/bin/python

Also, change the lines that look like:
tiddlywebconfig_dir = '/tmp'

os.environ['PYTHON_EGG_CACHE'] = '/tmp'

To something like (replacing the start with your home directory:
tiddlywebconfig_dir = '/home/bengillies/twconfig/'

os.environ['PYTHON_EGG_CACHE'] = '/home/bengillies/.python-eggs'

You can save with ctrl-o, and then exit with ctrl-x (assuming you're using nano). Now, we need to alter the tiddlywebconfig.py file to finish things off:
cd ~/twconfig
nano tiddlywebconfig.py

Go down to the last but one line (the one before the closing }), and start a new line after it. Enter information so the the file looks like this:
# A basic configuration.
# Run "pydoc tiddlyweb.config" for details on configuration items.

config = {
    'system_plugins': ['tiddlywebwiki'],
    'secret': 'f433fbfcf1871ea99ddb75e97ff5512f5513414d', #this string will be different in your file. Just leave it as it is.
    'twanager_plugins': ['tiddlywebwiki'],
    'server_store': ['text', {'store_root': '/home/bengillies/<instance_name>/store'}],
    'server_prefix': '/cgi-bin/index.cgi',
    'server_host': {
        'scheme': 'http',
        'host': '<your domain name here>',
        'port': '80'
    },
}


That's it. You should now be able to point your web browser to http://your_domain.com/cgi-bin/index.cgi/recipes/default/tiddlers.wiki and start editing.

For more instructions on how to customise your tiddlyweb installation, it's probably best to look directly on the TiddlyWeb site at http://tiddlyweb.com

Comments

name:
comment:
I would like to propose not to wait until you earn big sum of cash to order goods! You can get the loans or just term loan and feel yourself fine
by Anonymous Coward