Re: [squid-users] Multiple hosts with cache_peer and urlpath_regex

From: Chris Malek <k.malek@dont-contact.us>
Date: Wed, 27 Feb 2008 13:08:46 -0500

I have tried what you were suggesting with regards to the pinger, but it
still doesn't work.
Here is my entire squid.conf without commented out lines.
Please have a look and if possible let me know what I should change in it.

Thanks
Chris

http_port 80

cache_peer 192.86.77.19 parent 80 0 no-query originserver name=server1
cache_peer 192.86.77.26 parent 80 0 no-query originserver name=server2
acl amanda5 urlpath_regex ^/amd5
acl view urlpath_regex ^/view

cache_peer_access server1 allow amd5
cache_peer_access server1 deny view
#never_direct deny amd5
   
cache_peer_access server2 allow view
cache_peer_access server2 deny amd5
#never_direct deny view

hierarchy_stoplist cgi-bin ?

acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY

acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

access_log /var/log/squid/access.log squid

pinger_program /usr/sbin/pinger

url_rewrite_host_header off

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

http_access allow localhost
acl port80 port 80
http_access allow port80
http_access allow amd5 view

http_access deny all

http_reply_access allow all

icp_access allow all

cache_effective_group squid

visible_hostname CSDCSP-U7

icp_port 0

always_direct allow all

coredump_dir /var/spool/squid

Amos Jeffries wrote:
> Chris Malek wrote:
>> Well...thank you for your suggestions, but i still have the same
>> problem.
>> In the cache.log everything looks OK except this one line: icmpSend:
>> send: (111) Connection refused
>>
>
> Ah, your pinger helper is not working.
>
> You may need to go to the dir you built squid and run "make
> install-pinger".
>
> If its a package. It may be bundled seperately or a help call to the
> maintainer.
>
> Squid 3.1+ has "pinger_enable" option to turn it off at run-time.
>
>
> Amos
>
>> Below are all the things that I have added to the squid.conf
>> Maybe there is some crucial mistake that squid newbie can't find :)
>> Anyway,
>> here it is:
>>
>> http_port 80
>> cache_peer 192.86.77.19 parent 80 0 no-query originserver name=server1
>> cache_peer 192.86.77.26 parent 80 0 no-query originserver name=server2
>> acl amd5 urlpath_regex ^/amd5
>> acl view urlpath_regex ^/view
>>
>> cache_peer_access server1 allow amd5
>> cache_peer_access server1 deny view
>> never_direct deny amd5
>> cache_peer_access server2 allow view
>> cache_peer_access server2 deny amd5
>> never_direct deny view
>>
>> http_access allow localhost
>> acl port80 port 80
>> http_access allow port80
>> http_access allow amd5 view
>>
>> always_direct allow all
>>
>>
>>
>>
>> Amos Jeffries wrote:
>>> Chris Malek wrote:
>>>> Hello squid users,
>>>>
>>>> I'm a bit puzzled here. I was recently asked to setup a squid box with
>>>> the following requirements:
>>>>
>>>> when people would hit http://example.com/srv1 that request should
>>>> go to
>>>> server1
>>>> and http://example.com/srv2 and that request should go to server2
>>>>
>>>> I have tried the following, but with no success:
>>>>
>>>> cache_peer ip.of.server1 parent 80 0 no-query originserver
>>>> name=server1
>>>> cache_peer ip.of.server2 parent 80 0 no-query originserver
>>>> name=server2
>>>> acl foo urlpath_regex ^/foo
>>>> cache_peer_access server2 allow foo
>>>> cache_peer_access server1 deny foo
>>>>
>>>>
>>>> I'm getting "The requested URL could not be retrieved" error.
>>>> Can anyone put me on right track here?
>>>
>>> not quite enough foo ;-)
>>>
>>> cache_peer_access server1 allow foo1
>>> cache_peer_access server1 deny foo2
>>> never_direct deny foo1
>>>
>>> cache_peer_access server2 allow foo2
>>> cache_peer_access server2 deny foo1
>>> never_direct deny foo2
>>>
>>> (I'm a bit fuzzy this morning, but I think I've got the never_direct
>>> allow/deny the right way round.)
>>>
>>> Amos
>
>

Received on Wed Feb 27 2008 - 11:08:58 MST

This archive was generated by hypermail pre-2.1.9 : Sat Mar 01 2008 - 12:00:06 MST