Running multiple squid instances on UbuntuDecember 3, 2008 at 7:00 pm | Posted in http | 2 Comments
Tags: squid, ubuntu
As described in earlier posts, our standard web application setup at work is TurboGears behind squid as transparent caching proxy behind Apache. One of the reasons for this setup is that we want fine granular control over the services.
Since we already decided to run each application in its own application server, we want to keep things separate in the squid layer as well. Which brings us to the challenge of running multiple squid instances. It turns out this isn’t too hard to do, reusing most of the standard squid installation on ubuntu.
- Create a link to have the squid deamon available under a different name:
ln /usr/sbin/squid squid2
- Create directories for logs and cache files:
chown proxy:proxy /var/log/squid2
chown proxy:proxy /var/spool/squid2
- Create the configuration in
- Create an init script. We started out with the one installed with the package and only had to apply the following changes:
# diff /etc/init.d/squid2 /etc/init.d/squid
< SQUID_ARGS="-D -sYC -f $CONF"
> SQUID_ARGS="-D -sYC"
< $DAEMON -z -f $CONF
> $DAEMON -z
- And install the init script running
update-rc.d squid2 defaults 99