Hosting Zope 3 on FreeBSD

Today I had to setup the hosting of a Zope 3 application on a FreeBSD server. I don't have much love for FreeBSD as I'm used to the Debian way of doing things, but after a couple of hours of tweaking the apache configuration files and the application I managed to get it properly running on that server.

Some pointers to quickly getting things done:

default apache on FreeBSD doesn't have mod_proxy installed. You need to recompile apache from /usr/ports/www/apache22, specifically enabling mod_proxy

make WITH_PROXY_MODULES=yes

Then make deinstall & make reinstall

The following needs to be added to your httpd.conf:
LoadModule proxy_module libexec/apache22/mod_proxy.so
LoadModule proxy_balancer_module libexec/apache22/mod_proxy_balancer.so
LoadModule proxy_ftp_module libexec/apache22/mod_proxy_ftp.so
LoadModule proxy_http_module libexec/apache22/mod_proxy_http.so
LoadModule proxy_connect_module libexec/apache22/mod_proxy_connect.so

(thanks to this page: http://sneezr.net/articles/2007/01/03/apache-2-2-gotchas)

One issue that surfaced when testing the zope3 setup was that the resources were not found on the server, using the following vhost settings:

<VirtualHost *:80>
    ServerName pixelblaster.ro
    ServerAlias www.pixelblaster.ro
    RewriteEngine on
    RewriteRule ^(/?.*) http://localhost:8080/test_site/++vh++http:%{SERVER_NAME}:80/++$1 [P,L]
  ProxyVia On
   ## prevent the webserver from beeing used as proxy
   <LocationMatch "^[^/]">
      Deny from all
  </LocationMatch>
</VirtualHost>
The "test_site" was a simple folder with a index_html page, but when accessing @@contents.html, all the resources (images, css) were missing. Tracing the problem through this thread to Jim Fulton's response it seems that the 'test_site' should be made a site, in the Zope 3 sense, and things really start working after that.

Comments