Wednesday, January 18, 2006

Simple Zope Clustering with Squid and Pound

Finally got a simple Squid/Pound/Zope setup running. There are so many howtos out there on how this is supposed to be setup, but each seem to be missing one part or adds in some extra complexities that aren't really needed.
  1. Pound is super simple to setup
  2. ZEO is a little more difficult
  3. Squid is the most complex
In this setup no redirector script is needed for squid since we can handle the mappings in the VirtualHostMonster mappings tab. We have to run pound and squid on the same port, but different interfaces so the url rewriting does the right thing. VirtualHostMonster itself won't rewrite the ports without some kind of rewriting done beforehand. This is ok since we can just bind Pound to the loopback interface and the squid to the external interface.
For reference I took the stock stock squid settings did the following:

changed :
http_access deny all
to:
http_access allow all

added:
http_port [external_ip]:80
httpd_accel_host 127.0.0.1
httpd_accel_port 80
httpd_accel_single_host on
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

Pound's config is simple also:

ListenHTTP 127.0.0.1,80
User zope
Group zope
LogLevel 1
UrlGroup ".*"
BackEnd 127.0.0.1,51003,1
BackEnd 127.0.0.1,51004,1
EndGroup

All that is left is to configure 2 ZEO Clients and a ZEO Storage Server to answer the requests. In one of the ZEO Clients go into the root VirtualHostMonster and on the mappings tab add one entry per domain name and site you want to serve.

Technorati Tags: , ,

No comments: