This guide explains how to set up
TiddlyWeb using
Apache on a fresh
CentOS 5 install behind a corporate firewall.
System Setup
(this assumes root access; commands might have to be wrapped in
su -c '...')
- set up HTTP proxy: export http_proxy="http://proxy.mycorp.com:8080"
- install EPEL repository using proxy:
- wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
- rpm -Uvh epel-release-5-3.noarch.rpm
- rm epel-release-5-3.noarch.rpm
- install mod_wsgi: yum install mod_wsgi
- install and upgrade Python setup tools:
- yum install python-setuptools python-devel
- easy_install -U setuptools pip
- install TiddlyWeb: pip install -U tiddlywebwiki
- create instances directory: mkdir /srv/tiddlyweb && cd /srv/tiddlyweb
- create instance "sandbox": twinstance sandbox && cd sandbox
- download TiddlyWeb's Apache module: wget http://github.com/tiddlyweb/tiddlyweb/raw/master/apache.py
- configure TiddlyWeb and Apache by editing /srv/tiddlyweb/sandbox/tiddlywebconfig.py and /etc/httpd/conf/httpd.conf, respectively (see Sample Configuration below)
- set correct permissions on Apache's logs directory: chmod 755 /var/log/httpd
- restart Apache: httpd -k restart
Sample Configuration
(using instance "sandbox" at
http://0.0.0.0:80/wiki/ under UNIX user
tiddlyweb; if available, a hostname should be used instead of the IP)
- /srv/tiddlyweb/sandbox/tiddlywebconfig.py
config = {
'secret': '<hash>',
'server_host': {
'scheme': 'http',
'host': '0.0.0.0',
'port': '80'
},
'server_prefix': '/wiki'
}
- /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot /srv/tiddlyweb/sandbox/public
ServerName 0.0.0.0
RedirectMatch ^/$ /wiki/
WSGIDaemonProcess sandbox_wiki user=tiddlyweb processes=2 threads=15
WSGIProcessGroup sandbox_wiki
WSGIScriptAlias /wiki /srv/tiddlyweb/sandbox/apache.py
</VirtualHost>