Learning things about Zope
So I was agonizing over getting SSL to Zope working.
M2Crypto might be nice, but it requires SWIG, which brings with it a version-dependency nightmare. Supports SWIG 1.3.6, I have 1.3.13, it doesn't work. Oh, great. I'm not going to downgrade.
Next choice was in fact my first choice, before I started looking into more 'native' solutions: Apache SSL proxy. I've used it many times before with great success, so I figured it would be a piece of cake.
Well, it almost was. The only problem was, once I got it up & running, the first page loaded a-ok but all the links pointed to the supposedly-proxied Zope server instead of the SSL-enabled Apache proxy. I soon enough figured out there must be something funny what Zope is doing to cause this, but I had no idea what. The headers looked OK through telnet-ssl. Then I noticed in the HTML an element I had never heard of before:
base
, with a
href
attribute.
With kind help from people on #zope, I found VirtualHostMonster, a product packaged with Zope. This thing is really pretty cool: with a simple ProxyPass directive in Apache, I'm able to make all the objects inside a folder in Zope to think they live on a different host, behind a different protocol, under a different directory. And it fixes the base href too. And the VirtualHostMonster doesn't require any configuration at all.
So,
ProxyPass / http://host:port/VirtualHostBase/https/vhost:443/path/to/stuff/VirtualHostRoot/
not only makes stuff on host:port appear on the Apache SSL vhost, it also makes things on the Zope located at host:port in the directory /path/to/stuff/ think they really are at vhost:443/ root.
Gotta remember this next time I'm reinventing the wheel.