Tramline

by Nate Aune last modified Jan 28, 2007 05:25 PM
Tramline tutorial

Read tramline-0.5.1/INSTALL.txt
Tramline requires Apache 2.0.55 or higher

1. Install Apache 2.0

sudo port install apache2  

(this will install Apache 2.2.3 on MacOSX)

###########################################################
# A startup item has been generated that will aid in
# starting apache2 with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
###########################################################

2. Configure Apache2 configuration file

cd /opt/local/apache2/conf
cp httpd.conf.sample httpd.conf
sudo vi httpd.conf


Change Apache2 to listen on port 81 instead of 80 to not conflict with default Apache 1.3

    - Listen 80
+ Listen 81


Test your config and restart Apache:

sudo /opt/local/apache2/bin/apachectl configtest
sudo /opt/local/apache2/bin/apachectl start


2. Install mod_python

sudo port install mod_python


To enable mod_python add

  LoadModule python_module modules/mod_python.so

to your apache2 config file:
/opt/local/apache2/conf/httpd.conf


3. Patch mod_python so filter is not flushed

Comment out the filter.flush() line in /opt/local/lib/python2.4/site-packages/mod_python/apache.py

-  filter.flush()
+ # filter.flush()

4. Install Tramline

Use setuptools to install Tramline

wget http://www.infrae.com/download/tramline/0.5.1/tramline-0.5.1.tar.gz
tar xvfz tramline-0.5.1.tar.gz
cd tramline-0.5.1
/opt/local/bin/python2.4 setup.py install

add the following to your apache2 config file:
/opt/local/apache2/conf/httpd.conf

<IfModule python_module>
PythonInputFilter tramline.core::inputfilter TRAMLINE_INPUT
PythonOutputFilter tramline.core::outputfilter TRAMLINE_OUTPUT
SetInputFilter TRAMLINE_INPUT
SetOutputFilter TRAMLINE_OUTPUT
PythonOption tramline_path /usr/local/tramline/files
</IfModule>

Test your config and restart Apache:

sudo /opt/local/apache2/bin/apachectl configtest
sudo /opt/local/apache2/bin/apachectl graceful


5. Add the rewrite rule

Edit the /opt/local/apache2/conf/httpd.conf file:

Zope 3

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/(/?.*) http://localhost:8080/++vh++http:localhost:81/++/$1 [P,L]
</IfModule>

Plone 2

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/localhost:81/plone/VirtualHostRoot/$1 [L,P]
</IfModule>

Test your config and restart Apache:/tramline-0.5.1/src/tramline

sudo /opt/local/apache2/bin/apachectl configtest
sudo /opt/local/apache2/bin/apachectl graceful

6. Install attramline


Install attramline

svn co https://svn.plone.org/svn/collective/attramline/trunk/ attramline

install attramline in your Plone instance using the quickinstaller.


7. Patch tramline so that it will work with attramline

The attramline README says that you need to patch Tramline.

cd tramline-0.5.1/src/tramline
patch < /path/to/attramline/tramline-snowsprint-attramline.patch
sdfsdf