Results 1 to 4 of 4

Thread: Need help setting up Squid

  1. #1
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu

    Need help setting up Squid

    I have installed squid by running

    Code:
    sudo aptitude install squid3 squid3-common
    Then I ahve added the following lines to /etc/squid3/squid.conf


    Code:
    acl mynetwork src 192.168.1.0/255.255.255.0
    http_access allow localhost manager
    http_access deny manager
    forwarded_for off
    Then I have restarted squid by

    Code:
    $ sudo /etc/init.d/squid3 restart
    Restarting Squid HTTP Proxy 3.x: squid3 Waiting.....................done.
    Creating Squid HTTP Proxy 3.x cache structure ... (warning).
    2013/03/19 23:48:09| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
    2013/03/19 23:48:09| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
    2013/03/19 23:48:09| WARNING: For now we will assume you meant to write /24
    2013/03/19 23:48:09| Creating Swap Directories
    2013/03/19 23:48:09| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
    2013/03/19 23:48:09| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
    2013/03/19 23:48:09| WARNING: For now we will assume you meant to write /24
    Then I have configured Iceweasel to use use http proxy 127.0.0.1 / Port 3128

    Web pages are loading okay but the /var/log/squid/access.log is empty.

    Does this mean squid is not working ?
    Lubuntu 14.04
    free
    showing high ram usage ? Read this
    When people say "you've changed " there's a 95% chance that you just stopped acting the way they wanted you to.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    11,887
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Need help setting up Squid

    Is the browser with the proxy settings running on the same machine as Squid? If so, is there an ACL and http_access directive that permits connections from localhost? What if you try connecting from a machine on the 192.168.1.0/24 network?

    Try connecting with "telnet localhost 3128" on the Squid box. Do you get a reply? If so, try entering this:
    Code:
    GET http://www.google.com/ HTTP/1.0
    [Enter]
    You have to hit Enter twice after the GET line. You should see the HTML code for the main Google page flash by on your screen.

    Try the same thing again from a network client. If you only have Windows clients, install putty and run telnet from that.

    What do you see in access.log now?
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu

    Re: Need help setting up Squid

    Quote Originally Posted by SeijiSensei View Post
    Is the browser with the proxy settings running on the same machine as Squid? If so, is there an ACL and http_access directive that permits connections from localhost? What if you try connecting from a machine on the 192.168.1.0/24 network?

    Try connecting with "telnet localhost 3128" on the Squid box. Do you get a reply? If so, try entering this:
    Code:
    GET http://www.google.com/ HTTP/1.0
    [Enter]
    You have to hit Enter twice after the GET line. You should see the HTML code for the main Google page flash by on your screen.

    Try the same thing again from a network client. If you only have Windows clients, install putty and run telnet from that.

    What do you see in access.log now?
    Yes the browser is running on the PC where squid is installed.

    I don't know about the http_access directive. I didn't set it.

    Code:
    tux@mypc:~$ telnet localhost 3128
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Code:
    tux@mypc:~$ GET http://www.google.com/ HTTP/1.0
    <!doctype html><html itemscope="itemscope" itemtype="http://schema.org/WebPage"><head><meta itemprop="image" content="/images/google_favicon_128.png"><title>Google</title><script>(function(){
    window.google={kEI:"JbZIUfziEsfQrQefgIHQBA",getEI:function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI},https:function(){return"https:"==window.location.protocol},kEXPI:"17259,39523,4000116,4001569,4001948,4001959,4001975,4002562,4002734,4003053,4003178,4003385,4003386,4003495,4003917,4004103,4004105,4004181,4004213,4004257,4004316,4004334,4004340,4004374,4004479,4004488,4004652,4004653,4004697,4004755,4004759,4004857,4004949,4005090",kCSI:{e:"17259,39523,4000116,4001569,4001948,4001959,4001975,4002562,4002734,4003053,4003178,4003385,4003386,4003495,4003917,4004103,4004105,4004181,4004213,4004257,4004316,4004334,4004340,4004374,4004479,4004488,4004652,4004653,4004697,4004755,4004759,4004857,4004949,4005090",ei:"JbZIUfziEsfQrQefgIHQBA"},authuser:0,ml:function(){},kHL:"en",time:function(){return(new Date).getTime()},log:function(a,
    b,c,h){var d=new Image,f=google.lc,e=google.li,g="";d.onerror=d.onload=d.onabort=function(){delete f[e]};f[e]=d;!c&&-1==b.search("&ei=")&&(g="&ei="+google.getEI(h));c=c||"/gen_204?atyp=i&ct="+a+"&cad="+b+g+"&zx="+google.time();a=/^http:/i;a.test(c)&&google.https()?(google.ml(Error("GLMM"),!1,{src:c}),delete f[e]):(d.src=c,google.li=e+1)},lc:[],li:0,Toolbelt:{},y:{},x:function(a,b){google.y[a.id]=[a,b];return!1},load:function(a,b){google.x({id:"l"+a},function(){google.load(a,b)})}};
    
    })();
    (function(){var d=!1;google.sn="webhp";google.timers={};google.startTick=function(a,b){google.timers[a]={t:{start:google.time()},bfr:!!b}};google.tick=function(a,b,h){google.timers[a]||google.startTick(a);google.timers[a].t[b]=h||google.time()};google.startTick("load",!0);
    try{}catch(e){}})();
    var _gjwl=location;function _gjuc(){var a=_gjwl.href.indexOf("#");if(0<=a&&(a=_gjwl.href.substring(a),0<a.indexOf("&q=")||0<=a.indexOf("#q=")))if(a=a.substring(1),-1==a.indexOf("#")){for(var d=0;d<a.length;){var b=d;"&"==a.charAt(b)&&++b;var c=a.indexOf("&",b);-1==c&&(c=a.length);b=a.substring(b,c);if(0==b.indexOf("fp="))a=a.substring(0,d)+a.substring(c,a.length),c=d;else if("cad=h"==b)return 0;d=c}_gjwl.href="/search?"+a+"&cad=h";return 1}return 0}
    function _gjp(){(!window._gjwl.hash||!window._gjuc())&&setTimeout(_gjp,500)};
    window._gjp&&_gjp();</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}</style><style>.h{font-family:arial,sans-serif}body{font-family:arial,sans-serif}td{font-family:arial,sans-serif}a{font-family:arial,sans-serif}p{font-family:arial,sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}.h{color:#36c}.q{color:#00c}.ts{border-collapse:collapse}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.ts td{padding:0}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px;font:18px arial,sans-serif}.gsfi{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds{display:inline-box;display: inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}body{background:#fff;color:black}a.gb1{color:#11c !important}a.gb2{color:#11c !important}a.gb3{color:#11c !important}a.gb4{color:#11c !important}.sblc{padding-top:5px}.lsbb{background:#eee;border:solid 1px;border-color:#ccc #999 #999 #ccc;height:30px}a{color:#11c;text-decoration:none}a:hover{text-decoration:underline}a:active{text-decoration:underline}.fl a{color:#36c}a:visited{color:#551a8b}a.gb1{text-decoration:underline}a.gb4{text-decoration:underline}a.gb3:hover{text-decoration:none}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px}#ghead a.gb2:hover{color:#fff !important}.lsbb{display:block}.ftl{display:inline-block;margin:0 12px}.lsb{background:url(/images/srpr/nav_logo80.png) 0 -258px repeat-x;border:none;color:#000;cursor:pointer;height:30px;margin:0;outline:0;font:15px arial,sans-serif;vertical-align:top}#fll a{display:inline-block;margin:0 12px}.lsb:active{background:#ccc}.lst:focus{outline:none}#addlang a{padding:0 3px}</style><script></script> </head><body dir="ltr" bgcolor="#fff"><script>(function(){var src='/images/srpr/nav_logo80.png';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;}
    if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}
    }
    })();</script><textarea id="csi" style="display:none"></textarea><div id="mngb"><div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="http://www.google.co.in/imghp?hl=en&tab=wi">Images</a> <a class=gb1 href="http://maps.google.co.in/maps?hl=en&tab=wl">Maps</a> <a class=gb1 href="https://play.google.com/?hl=en&tab=w8">Play</a> <a class=gb1 href="http://www.youtube.com/?gl=IN&tab=w1">YouTube</a> <a class=gb1 href="http://news.google.co.in/nwshp?hl=en&tab=wn">News</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 href="https://drive.google.com/?tab=wo">Drive</a> <a class=gb1 style="text-decoration:none" href="http://www.google.co.in/intl/en/options/"><u>More</u> &raquo;</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a href="http://www.google.co.in/history/optout?hl=en" class=gb4>Web History</a> | <a  href="/preferences?hl=en" class=gb4>Settings</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=en&continue=http://www.google.co.in/" class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div></div><center><br clear="all" id="lgpd"><div id="lga"><div style="padding:28px 0 3px"><div dir="ltr" title="Google" align="left" id="hplogo" onload="window.lol&&lol()" style="height:110px;width:276px;background:url(/images/srpr/logo1w.png) no-repeat"><div nowrap="nowrap" style="color:#777;font-size:16px;font-weight:bold;position:relative;left:214px;top:70px">India</div></div></div><br></div><form action="/search" name="f"><table cellpadding="0" cellspacing="0"><tr valign="top"><td width="25%">&nbsp;</td><td align="center" nowrap="nowrap"><input name="ie" value="ISO-8859-1" type="hidden"><input value="en-IN" name="hl" type="hidden"><input name="source" type="hidden" value="hp"><div class="ds" style="height:32px;margin:4px 0"><input autocomplete="off" class="lst" value="" title="Google Search" maxlength="2048" name="q" size="57" style="color:#000;margin:0;padding:5px 8px 0 6px;vertical-align:top"></div><br style="line-height:0"><span class="ds"><span class="lsbb"><input class="lsb" value="Google Search" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" value="I'm Feeling Lucky" name="btnI" type="submit" onclick="if(this.form.q.value)this.checked=1; else top.location='/doodles/'"></span></span></td><td class="fl sblc" align="left" nowrap="nowrap" width="25%"><a href="/advanced_search?hl=en-IN&amp;authuser=0">Advanced search</a><a href="/language_tools?hl=en-IN&amp;authuser=0">Language tools</a></td></tr></table><input type="hidden" id="gbv" name="gbv" value="1"></form><div id="gac_scont"></div><div style="font-size:83%;min-height:3.5em"><br><div id=als><font size=-1 id=addlang>Google.co.in offered in: <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=hi&amp;source=homepage">Hindi</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=bn&amp;source=homepage">Bengali</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=te&amp;source=homepage">Telugu</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=mr&amp;source=homepage">Marathi</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=ta&amp;source=homepage">Tamil</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=gu&amp;source=homepage">Gujarati</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=kn&amp;source=homepage">Kannada</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=ml&amp;source=homepage">Malayalam</a> <a href="http://www.google.co.in/setprefs?sig=0_PIYi7T38gJbD_hvbPHxCqHxYRlo%3D&amp;hl=pa&amp;source=homepage">Punjabi</a></font><br><br></div></div><span id="footer"><div style="font-size:10pt"><div id="fll" style="margin:19px auto;text-align:center"><a href="/intl/en/ads/">Advertising&nbsp;Programs</a><a href="http://www.google.co.in/services/">Business Solutions</a><a href="https://plus.google.com/104205742743787718296" rel="publisher">+Google</a><a href="/intl/en/about.html">About Google</a><a href="http://www.google.co.in/setprefdomain?prefdom=US&amp;sig=0_akXYa7Z0a35J6LQBeebrhkc1DGQ%3D" id="fehl">Google.com</a></div></div><p style="color:#767676;font-size:8pt">&copy; 2013 - <a href="/intl/en/policies/">Privacy & Terms</a></p></span></center><div id=xjsd></div><div id=xjsi><script>if(google.y)google.y.first=[];(function(){var b;function c(a){window.setTimeout(function(){var d=document.createElement("script");d.src=a;document.getElementById("xjsd").appendChild(d)},0)}google.dljp=function(a){b=a;google.xjsi||(google.xjsu=a,c(b))};google.dlj=c;})();
    if(!google.xjs){google.dstr=[];google.rein=[];window._=window._||{};window._._DumpException=function(e){throw e};if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=new Date().getTime();}google.dljp('/xjs/_/js/hp/sb_he,pcc/rt\x3dj/ver\x3dkZzP7WLWDa8.en_US./d\x3d1/sv\x3d1/rs\x3dAItRSTMrrcrCAA791p2QB-ap_BkElvsTOw');google.xjs=1;}google.pmc={sb:{"agen":false,"cgen":true,"client":"heirloom-hp","dh":true,"ds":"","eqch":true,"fl":true,"host":"google.co.in","jsonp":true,"msgs":{"lcky":"I\u0026#39;m Feeling Lucky","lml":"Learn more","oskt":"Input tools","psrc":"This search was removed from your \u003Ca href=\"/history\"\u003EWeb History\u003C/a\u003E","psrl":"Remove","sbit":"Search by image","srch":"Google Search"},"ovr":{"ms":1},"pq":"","qcpw":false,"scd":10,"sce":5,"stok":"06SwqgA-wFXQKhHuh74Xx1_pHS4"},hp:{},pcc:{}};google.y.first.push(function(){if(google.med){google.med('init');google.initHistory();google.med('history');}google.History&&google.History.initialize('/');google.hs&&google.hs.init&&google.hs.init()});if(google.j&&google.j.en&&google.j.xi){window.setTimeout(google.j.xi,0);}</script></div><script>(function(){var b,c,d,e;function g(a,f){a.removeEventListener?(a.removeEventListener("load",f,!1),a.removeEventListener("error",f,!1)):(a.detachEvent("onload",f),a.detachEvent("onerror",f))}function h(a){e=(new Date).getTime();++c;a=a||window.event;a=a.target||a.srcElement;g(a,h)}var k=document.getElementsByTagName("img");b=k.length;
    for(var l=c=0,m;l<b;++l)m=k[l],m.complete||"string"!=typeof m.src||!m.src?++c:m.addEventListener?(m.addEventListener("load",h,!1),m.addEventListener("error",h,!1)):(m.attachEvent("onload",h),m.attachEvent("onerror",h));d=b-c;
    function n(){if(google.timers.load.t){google.timers.load.t.ol=(new Date).getTime();google.timers.load.t.iml=e;google.kCSI.imc=c;google.kCSI.imn=b;google.kCSI.imp=d;void 0!==google.stt&&(google.kCSI.stt=google.stt);google.csiReport&&google.csiReport()}}window.addEventListener?window.addEventListener("load",n,!1):window.attachEvent&&window.attachEvent("onload",n);google.timers.load.t.prt=e=(new Date).getTime();})();
    </script></body></html><?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
      <title>404 - Not Found</title>
     </head>
     <body>
      <h1>404 - Not Found</h1>
     </body>
    </html>
    tux@mypc:~$ sudo cat /var/log/squid/access.log
    [sudo] password for tux: 
    tux@mypc:~$
    As you can see there is nothing in that log. There are no network clients. This is the only PC.
    Lubuntu 14.04
    free
    showing high ram usage ? Read this
    When people say "you've changed " there's a 95% chance that you just stopped acting the way they wanted you to.

  4. #4
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu

    Re: Need help setting up Squid

    I am very sorry coz I read the wrong log /var/log/squid/access.log. It was supposed to be /var/log/squid3/access.log.

    The log is now populated.

    Thanks a lot.
    Lubuntu 14.04
    free
    showing high ram usage ? Read this
    When people say "you've changed " there's a 95% chance that you just stopped acting the way they wanted you to.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •