[squid-users] squirm 1.23 conditional redirect to a local mirror patch

From: Mark Cooke <mpc@dont-contact.us>
Date: Sun, 24 Feb 2002 02:12:21 +0000 (GMT)

Hi Chris, all,

It's been a while since I last played with squirm, but I put
together a quick and ugly hack to squirm 1.23 to help optimise
our setup.

We have squid running for a smallish group of users, and we also keep
mirrors of various site - ximian, redhat, suse, security updates, etc.
I was redirecting unconditionally to the local mirror, and occasional
problems would crop up with the mirror being out of sync.

To fix this, I added an optional 4th field to regex/regexi lines,
which is a 'disk_mirror_replacement' field. It works in a similar way
to a normal regex(i) redirection, but only if the file exists is the
redirection done.


regex ^ftp://updates\.redhat\.com/(.+rpm)\1

Essentially the above redirects from updates.redhat.com to our
internal ftp server any requests for *.rpm, only if the requested
file exists in /var/ftp/pub/mirrors/redhat/updates/

Patch is at ftp://pc24.sr.bham.ac.uk/pub/packages/redhat-7.2/SOURCES/squirm-mirror.diff

A redhat RPM is at ftp://pc24.sr.bham.ac.uk/pub/packages/redhat-7.2/RPMS/i386/squirm-1.23-2mirror.i386.rpm

Thanks for the efforts you made putting squirm together in the first



Mark Cooke                  The views expressed above are mine and are not
Systems Programmer          necessarily representative of university policy
University Of Birmingham    URL: http://www.sr.bham.ac.uk/~mpc/
Received on Sat Feb 23 2002 - 19:12:20 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:06:31 MST