Link to home
Start Free TrialLog in
Avatar of Haho
Haho

asked on

Using Squid as a mirror / cache site - doesn't work..?

hi,

This is my first time using Squid.
I am trying to create a mirror site, mirror.domain1.com in another
server for my web site www.domain1.com which is quite slow to access.
The mirror site is located in another country where it will cater for
faster access to customers in that region.

In mirror.domain1.com, I have squid.conf as :

http_port 80
httpd_accel_host www.domain1.com
httpd_accel_port 80
# httpd_accel_with_proxy on
httpd_accel_uses_host_header on
icp_port 0
cache_effective_user nobody
cache_effective_group nobody
acl QUERY urlpath_regex cgi-bin \? /perl
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
no_cache deny QUERY
redirect_program /usr/local/squid/redirect2.pl
redirect_children 10
redirect_rewrites_host_header off
http_access allow manager localhost
http_access allow all
http_access allow localhost
http_access deny manager
http_access deny all

---------------------------------------------------------------
redirect2.pl is:

#!/usr/bin/perl
$|=1;
while (<>) {
        print($_), next
        if s|mirror.domain1.com(:80)|www.domain1.com|o;
        # send it unchanged to plain apache server (http_docs)
        print;
}

--------------------------------------------------------------
I tested it and it doesn't seem to cache at all.. there is nothing
in access.log which relates to www.domain1.com ..

Can anybody go through my configuration  and let me know what should I
correct or how should I correctly test this better?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of hangman
hangman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial