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


Then make deinstall & make reinstall

The following needs to be added to your httpd.conf:
LoadModule proxy_module libexec/apache22/
LoadModule proxy_balancer_module libexec/apache22/
LoadModule proxy_ftp_module libexec/apache22/
LoadModule proxy_http_module libexec/apache22/
LoadModule proxy_connect_module libexec/apache22/

(thanks to this page:

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>
    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
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.