Deliverance and static files behind Apache

Tags: plone, deliverance

On my http://reinout.vanrees.org site, I’ve basically got a load of static html files with deliverance in front of it. Deliverance works fine with local files like that. After all, in many cases the theme it uses is local.

I did have to make two small fixes:

  • Fixed error in rewriting URLs of fileproxy’d directories in case we just tacked on an /index.html as we detected a directory.

  • Redirect exceptions by the proxy_to_file method (for adding a trailing slash) now result in an actual direct redirect instead of an XML parsing error.

These two small fixes are on a branch right now. I will make sure they end up in the trunk version; first I need to make sure my changes are well-tested.

I had one major problem: the URLs to other pages (and to the theme) all came out like http://localhost:1002 instead of http://reinout.vanrees.org/. No amount of Apache rewriterules seemed to fix it. Just a rewriterule was all I ever needed for Plone or Zope as they use a so-called “virtual host monster” (what a name…) that handles all the rewriting magic.

The solution: add ProxyPreserveHost On to your Apache configuration. This sends the host name that Apache gets from the client on towards deliverance. When deliverance gets that host name, it automatically does the right thing.

I’m a happy deliverance user. The project name however always puts christian phrases in my mind like “He has delivered me from all html woes” etcetera :-) Ah well.

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):