Re: [squid-users] Web accelerator settings for multiple sites on different servers

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 08 Oct 2008 01:08:40 +1300

Odiobill wrote:
> Hi, I configured an OpenVZ cluster for my company, where there is a VE with
> public IP adress that provides web-accelerator for other VEs that are
> running on a different network, with private addresses.
>
> To realize it, I used a configuration similar to this one within my
> squid.conf:
>
>> -- CUT HERE --<
> http_port 80 accel vhost
> http_port 3128
>
> acl our_network src 192.168.10.0/24
> http_access allow our_network
>
> acl our_domains dstdomain "/etc/squid/sites.conf"
> http_access allow our_domains
>
> http_access deny all
>
> cache_peer 192.168.10.100 parent 80 0 no-query originserver login=PASS
> name=100
> cache_peer_domain 100 1st.example.org 3rd.example.org
>
> cache_peer 192.168.10.101 parent 80 0 no-query originserver login=PASS
> name=101
> cache_peer_domain 101 2nd.example.org 4th.example.org 5th.example.org
>> -- CUT HERE --<
>
> /etc/squid/sites.conf lists every hostname referred by cache_peer_domain
> directives.
>
> The problem is that we have ten virtual servers to accelerate, and some of
> these are providing hosting for 20 or 30 websites (each one).
> There is better way to accomplish this, maybe without the need to write down
> hostnames both on the external file and squid.conf itself?

Yes there is :-) cache_peer_access.

I use it something roughly like this:

   cache_peer .... name=serverA
   acl serverA dstdomain "/etc/squid/serverA-domains"
   http_access allow serverA
   cache_peer_access serverA allow serverA
   cache_peer_access serverA deny all

... repeat for each host.

You can then automate the squid.conf generation if you need.
Any alterations to the data files still require a squid
reload/reconfigure to activate.

Amos

-- 
Please use Squid 2.7.STABLE4 or 3.0.STABLE9
Received on Tue Oct 07 2008 - 12:08:43 MDT

This archive was generated by hypermail 2.2.0 : Tue Oct 07 2008 - 12:00:03 MDT