Two squid and one balancer [ SOLUTION ]

  • Hi to all,
    I want to share my configuration for two squid proxy and one balancer for proxy connection ( I used ZenLoadBalancer ).

    1. First of all I created a far with 2 squid and the redireection for port 3128 from balancer to squid farm.
    2. ( problem ) squid now saw only the Balancer IP and not the Client IP so :
    3. I modded the squid.conf with :

    logformat squid      %ts.%03tu %6tr %{X-Forwarded-For}>h %>a %Ss/%03>Hs %<st %rm="" %ru="" %[un="" %sh="" %<a="" %mt[="" code]<br="">4\. then for real time statistic i modded the follow lines on /usr/local/www/squid_monitor_data.php
    [quote]44                         show_tds(array("Date", "IP Client", "IP Balancer", "Status", "Address", "User", "Destination"));
    57                                 $logline_dest = preg_split("/\//", $logline[10]);
    67                                 echo "{$logline[3]}\n";
    68                                 echo "{$logline[4]}\n";
    69                                 echo "{$logline[5]}\n";    <----- LINE ADDED
    70                                 echo "{$logline[8]}\n";
    71                                 echo "{$logline[9]}\n";[/quote]
    5\. then I tweaked the lighthttp to generate the report correctly, in the directory  /usr/local/www/lightsquid/ I modded on the follow lines :
    [code]130            ($Ltimestamp,$Lelapsed,$Lhost,$LhostBAL,$Ltype,$Lsize,$Lmethod,$Lurl,$Luser,$Lhierarchy,$Lconttype,@Lrest)=split;[/code]

Log in to reply