HOWTO get squid and zope to cooperate

From Chaos

Jump to: navigation, search
This article is part of the HOWTO series.

Summary

Most of the how-to's I found for getting Squid to run in front of Zope were either poorly documented, or incomplete. I have put this together as a means to and end--hopefully it will be useful to someone other than myself. Of course, this how-to won't cover every aspect of setting up Squid and/or Zope.

Procedure

1. Please download and install/compile Squid 2.x.
2. Put the lines below in your squid.conf (if you want documentation, please look at the pre-existing config and/or man pages).

http_port xxx.xxx.xxx.xxx:80

httpd_accel_host virtual
httpd_accel_uses_host_header on
httpd_accel_with_proxy on

redirect_program /path/to/iredir/iRedirector.py
redirect_children 30

redirect_rewrites_host_header off

acl self_port   port 80
acl self_dst    dst xxx.xxx.xxx.xxx

http_access deny !self_port

never_direct allow self_dst self_port

cache_peer localhost parent 8080 0 no-query default
acl zope_domain dstdomain mydomain.com
acl all src 0.0.0.0/0.0.0.0

cache_peer_access localhost allow zope_domain
cache_dir ufs /path/to/your/squid/cache 10000 16 256 

3. Obtain iRedirector from here.
4. Decompress it, and put it somewhere that's easy to remember.
5. Change to the directory, and modify iRedirector.py with wherever you want the logfiles to go. Remember to verify the path to Python.
6. Edit redirector_class.py, and modify the logfile to wherever you want it to go. Also change the 'sitemap' definition(s), such that they will match your website. Note: You are not limited to only using this redirector/Squid configuration for Plone sites. If you have Apache sites and wish to run them behind Squid as well, add more definitions. My example is below.

(10, '[\S]*kyle.gadoz.com'): 'localhost:8080/VirtualHostBase/http/$netloc$:80/Plone/VirtualHostRoot',

7. Fire up Squid, verify that it started correctly.
8. Test your new Squid + Zope installation!

References

Personal tools
Namespaces
Variants
Actions
Navigation
Sponsored Links
Toolbox