<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nongraphical.com &#187; squid3-chain</title>
	<atom:link href="http://nongraphical.com/tag/squid3-chain/feed/" rel="self" type="application/rss+xml" />
	<link>http://nongraphical.com</link>
	<description>A dynamic trapeze of web design, programming, and randomness.</description>
	<lastBuildDate>Wed, 09 Jun 2010 18:15:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Updated Squid 3 configuration</title>
		<link>http://nongraphical.com/2008/11/updated-squid-3-configuration/</link>
		<comments>http://nongraphical.com/2008/11/updated-squid-3-configuration/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 03:54:51 +0000</pubDate>
		<dc:creator>fyhuang</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[squid3-chain]]></category>

		<guid isPermaLink="false">http://nongraphical.com/?p=130</guid>
		<description><![CDATA[Here is the up&#173;dat&#173;ed ver&#173;sion of my pre&#173;vi&#173;ous au&#173;then&#173;ti&#173;cat&#173;ing/for&#173;ward&#173;ing Squid 3 con&#173;fig. It adds some things and fix&#173;es some things. In par&#173;tic&#173;u&#173;lar, the peer ex&#173;clu&#173;sion rules from the pre&#173;vi&#173;ous con&#173;fig were not work&#173;ing - this one should cor&#173;rect&#173;ly not use the par&#173;ent prox&#173;ies when query&#173;ing &#8220;lo&#173;cal ad&#173;dress&#173;es&#8221;. As be&#173;fore, the con&#173;fig&#173;u&#173;ra&#173;tion file con&#173;tains two proxy [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the up&shy;dat&shy;ed ver&shy;sion of my <a href="http://nongraphical.com/2008/09/squid-3-proxy-chaining/">pre&shy;vi&shy;ous au&shy;then&shy;ti&shy;cat&shy;ing/for&shy;ward&shy;ing Squid 3 con&shy;fig</a>. It adds some things and fix&shy;es some things. In par&shy;tic&shy;u&shy;lar, the peer ex&shy;clu&shy;sion rules from the pre&shy;vi&shy;ous con&shy;fig were not work&shy;ing - this one should cor&shy;rect&shy;ly <em>not use</em> the par&shy;ent prox&shy;ies when query&shy;ing &#8220;lo&shy;cal ad&shy;dress&shy;es&#8221;. As be&shy;fore, the con&shy;fig&shy;u&shy;ra&shy;tion file con&shy;tains two proxy servers for load bal&shy;anc&shy;ing; it can be ex&shy;tend&shy;ed easi&shy;ly to in&shy;clude more.<span id="more-130"></span> Here it is for your en&shy;joy&shy;ment:</p>

<pre><code>cache_ef&shy;fec&shy;tive_user proxy
cache_ef&shy;fec&shy;tive_group proxy

http_port 3128
http_ac&shy;cess al&shy;low all

acl lo&shy;cal_ips dst 127.0.0.0/8 192.168.0.0/24 10.10.0.0/16
acl lo&shy;cal_servers dst&shy;do&shy;main lo&shy;cal&shy;host my.lo&shy;cal.do&shy;main
nev&shy;er_di&shy;rect al&shy;low all
al&shy;ways_di&shy;rect al&shy;low lo&shy;cal_ips
al&shy;ways_di&shy;rect al&shy;low lo&shy;cal_servers

acl http-on&shy;ly port 80
cache_peer first&shy;Proxy.site.com par&shy;ent 3128 3190 no-query proxy-on&shy;ly login=User&shy;name:Pass&shy;word name=prx1
cache_peer sec&shy;ond&shy;Proxy.site.com par&shy;ent 3128 3190 no-query proxy-on&shy;ly login=User&shy;name:Pass&shy;word de&shy;fault name=prx2

# This makes on&shy;ly HTTP load bal&shy;anced
cache_peer_ac&shy;cess prx1 deny all
cache_peer_ac&shy;cess prx1 al&shy;low http-on&shy;ly
cache_peer_ac&shy;cess prx2 al&shy;low all

# Re&shy;in&shy;force&shy;ment of di&shy;rect rules
cache_peer_ac&shy;cess prx1 deny lo&shy;cal_ips
cache_peer_ac&shy;cess prx1 deny lo&shy;cal_servers
cache_peer_ac&shy;cess prx2 deny lo&shy;cal_ips
cache_peer_ac&shy;cess prx2 deny lo&shy;cal_servers

# Some time&shy;outs
con&shy;nect_time&shy;out 8 sec&shy;onds
peer_con&shy;nect_time&shy;out 3 sec&shy;onds

hier&shy;ar&shy;chy_sto&shy;plist cgi-bin ?

cache_mem 64 MB
max&shy;i&shy;mum_ob&shy;ject_size_in_mem&shy;o&shy;ry 64 KB

cache_re&shy;place&shy;ment_pol&shy;i&shy;cy heap GDSF
cache_dir aufs /var/spool/squid3 6000 16 256  # Make sure to check this path
max&shy;i&shy;mum_ob&shy;ject_size 16384 KB

ac&shy;cess_log /var/log/squid3/ac&shy;cess.log squid  # Make sure to check this path

shut&shy;down_life&shy;time 3 sec&shy;onds

de&shy;bug_op&shy;tions ALL,1
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://nongraphical.com/2008/11/updated-squid-3-configuration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Squid 3 authenticating proxy chaining</title>
		<link>http://nongraphical.com/2008/09/squid-3-proxy-chaining/</link>
		<comments>http://nongraphical.com/2008/09/squid-3-proxy-chaining/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 02:41:36 +0000</pubDate>
		<dc:creator>fyhuang</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[squid3-chain]]></category>

		<guid isPermaLink="false">http://blog.nongraphical.com/?p=69</guid>
		<description><![CDATA[My school us&#173;es an NTLM-au&#173;then&#173;ti&#173;cat&#173;ing proxy server, and this caus&#173;es prob&#173;lems with lots of ap&#173;pli&#173;ca&#173;tions which don&#8217;t sup&#173;port proxy servers. Many, many so&#173;lu&#173;tions have been pro&#173;posed to this prob&#173;lem, but I&#8217;ll fo&#173;cus on one that I find par&#173;tic&#173;u&#173;lar&#173;ly ap&#173;peal&#173;ing: set&#173;ting up a non-au&#173;then&#173;ti&#173;cat&#173;ing per&#173;son&#173;al proxy server which for&#173;wards re&#173;quests to the main proxy server.

Up&#173;date: use [...]]]></description>
			<content:encoded><![CDATA[<p>My school us&shy;es an NTLM-au&shy;then&shy;ti&shy;cat&shy;ing proxy server, and this caus&shy;es prob&shy;lems with lots of ap&shy;pli&shy;ca&shy;tions which don&#8217;t sup&shy;port proxy servers. Many, many so&shy;lu&shy;tions have been pro&shy;posed to this prob&shy;lem, but I&#8217;ll fo&shy;cus on one that I find par&shy;tic&shy;u&shy;lar&shy;ly ap&shy;peal&shy;ing: set&shy;ting up a non-au&shy;then&shy;ti&shy;cat&shy;ing per&shy;son&shy;al proxy server which for&shy;wards re&shy;quests to the main proxy server.</p>

<p><strong>Up&shy;date: use the <a href="http://nongraphical.com/2008/11/updated-squid-3-configuration/">new ver&shy;sion of this con&shy;fig file</a> - it works bet&shy;ter.</strong>
<span id="more-69"></span></p>

<p>Here&#8217;s why this so&shy;lu&shy;tion is op&shy;ti&shy;mal, or at least bet&shy;ter than other cur&shy;rent&shy;ly-avail&shy;able so&shy;lu&shy;tions. Con&shy;sid&shy;er one method of forc&shy;ing pro&shy;grams to use the proxy (un&shy;der Lin&shy;ux), which is set&shy;ting the http_proxy and ftp_proxy en&shy;vi&shy;ron&shy;ment vari&shy;ables. Pro&shy;grams that <em>sup&shy;port</em> proxy servers <strong>and</strong> that sup&shy;port proxy <em>au&shy;then&shy;ti&shy;ca&shy;tion</em> (be&shy;cause my school us&shy;es an au&shy;then&shy;ti&shy;cat&shy;ing proxy), no&shy;tably apt-get, wget, and lynx, will use those en&shy;vi&shy;ron&shy;ment vari&shy;ables to con&shy;nect through the proxy server. Pro&shy;grams that don&#8217;t, or those that don&#8217;t read the en&shy;vi&shy;ron&shy;ment vari&shy;ables (biggest of&shy;fend&shy;ers: most GNOME pro&shy;grams), won&#8217;t.</p>

<p>The biggest prob&shy;lem with this method is its in&shy;con&shy;sis&shy;ten&shy;cy - it&#8217;s im&shy;pos&shy;si&shy;ble to know nec&shy;es&shy;sar&shy;i&shy;ly which pro&shy;grams work, and which pro&shy;grams sup&shy;port proxy au&shy;then&shy;ti&shy;ca&shy;tion; and in ad&shy;di&shy;tion, one needs to re-en&shy;ter one&#8217;s proxy set&shy;tings in the en&shy;vi&shy;ron&shy;ment vari&shy;ables (bashrc, prob&shy;a&shy;bly), in the GNOME set&shy;tings, and prob&shy;a&shy;bly in&shy;di&shy;vid&shy;u&shy;al&shy;ly for some pro&shy;grams too. On top of that, many GNOME pro&shy;grams don&#8217;t (or didn&#8217;t) sup&shy;port proxy au&shy;then&shy;ti&shy;ca&shy;tion&#8230; fi&shy;nal&shy;ly, it is im&shy;pos&shy;si&shy;ble in the en&shy;vi&shy;ron&shy;ment vari&shy;able to spec&shy;i&shy;fy which con&shy;nec&shy;tions (like those to the lo&shy;cal net&shy;work) should be di&shy;rect, and which should be through the proxy.</p>

<p>Con&shy;sid&shy;er a slight&shy;ly bet&shy;ter method, which is <code>proxychains</code>. In order to use prox&shy;y&shy;chains, one must type com&shy;mands like so:</p>

<pre><code># In&shy;stead of writ&shy;ing
su&shy;do apt-get in&shy;stall ubun&shy;tu-desk&shy;top
# One must write
su&shy;do prox&shy;y&shy;chains apt-get in&shy;stall ubun&shy;tu-desk&shy;top
</code></pre>

<p>Okay, so that&#8217;s not too bad, if a lit&shy;tle bit in&shy;con&shy;ve&shy;nient. The good thing about this method is that prox&shy;y&shy;chains can &#8220;prox&shy;i&shy;fy&#8221; pro&shy;grams that don&#8217;t sup&shy;port proxy servers na&shy;tive&shy;ly. The proxy au&shy;then&shy;ti&shy;ca&shy;tion user&shy;name and pass&shy;word are al&shy;so stored in one place on&shy;ly: the prox&shy;y&shy;chains con&shy;fig&shy;u&shy;ra&shy;tion file. The on&shy;ly two prob&shy;lems with this method? 1. Typ&shy;ing <code>prox&shy;y&shy;chains</code> be&shy;fore ev&shy;ery com&shy;mand, and 2. The in&shy;abil&shy;i&shy;ty of <code>prox&shy;y&shy;chains</code> (at least the most re&shy;cent ver&shy;sion) to make some con&shy;nec&shy;tions di&shy;rect (i.e. those on the lo&shy;cal net&shy;work) and some to go through the proxy, just like the pre&shy;vi&shy;ous method.</p>

<p>Fine, so those meth&shy;ods aren&#8217;t ide&shy;al. What makes the Squid 3 method bet&shy;ter? Well, on the sur&shy;face it solves most, if not all, the prob&shy;lems that the pre&shy;vi&shy;ous meth&shy;ods had. It doesn&#8217;t re&shy;quire au&shy;then&shy;ti&shy;ca&shy;tion (that is han&shy;dled trans&shy;par&shy;ent&shy;ly by the per&shy;son&shy;al proxy) and au&shy;then&shy;ti&shy;ca&shy;tion in&shy;for&shy;ma&shy;tion is stored in one place on&shy;ly (the squid.conf). This alone makes many pro&shy;grams work much bet&shy;ter. You can cache far more per&shy;son&shy;al&shy;ized web data (the school&#8217;s proxy serv&shy;ing hun&shy;dreds of stu&shy;dents prob&shy;a&shy;bly won&#8217;t cache data that <em>you, per&shy;son&shy;al&shy;ly</em> fre&shy;quent&shy;ly use), and sav&shy;ing proxy in&shy;for&shy;ma&shy;tion in many dif&shy;fer&shy;ent places is okay, be&shy;cause if your user&shy;name and pass&shy;word change, you don&#8217;t need to change it in all those dif&shy;fer&shy;ent places. Fi&shy;nal&shy;ly, one can still use prox&shy;y&shy;chains to prox&shy;i&shy;fy mis&shy;be&shy;hav&shy;ing pro&shy;grams, be&shy;cause Squid can be con&shy;fig&shy;ured to con&shy;nect to some ad&shy;dress&shy;es di&shy;rect&shy;ly in&shy;stead of prox&shy;y&shy;ing through the par&shy;ent proxy. Its biggest prob&shy;lem is that run&shy;ning Squid more or less re&shy;quires Lin&shy;ux.</p>

<p>Okay, enough ban&shy;ter. Let&#8217;s learn how to do this thing. I&#8217;m us&shy;ing Ubun&shy;tu 8.04 server (on a vir&shy;tu&shy;al ma&shy;chine), so the&shy;se in&shy;struc&shy;tions may or may not be Ubun&shy;tu-speci&shy;fic. Here&#8217;s my con&shy;fig file:</p>

<pre><code>cache_ef&shy;fec&shy;tive_user proxy # Ubun&shy;tu-speci&shy;fic?
cache_ef&shy;fec&shy;tive_group proxy # Ubun&shy;tu-speci&shy;fic?

http_port 3128
http_ac&shy;cess al&shy;low all

cache_peer prx1 par&shy;ent 3128 3190 no-query login=user&shy;name:pass
cache_peer prx2 par&shy;ent 3128 3190 no-query login=user&shy;name:pass
cache_peer_ac&shy;cess prx1 al&shy;low all
cache_peer_ac&shy;cess prx2 al&shy;low all

hier&shy;ar&shy;chy_sto&shy;plist cgi-bin ?

cache_mem 64 MB # How much mem&shy;o&shy;ry Squid us&shy;es for cache.
                # Make low&shy;er if you have less mem&shy;o&shy;ry
max&shy;i&shy;mum_ob&shy;ject_size_in_mem&shy;o&shy;ry 64 KB # Make low&shy;er if you have less mem&shy;o&shy;ry

cache_re&shy;place&shy;ment_pol&shy;i&shy;cy heap LFU&shy;DA
cache_dir aufs /var/spool/squid3 6000 16 256
max&shy;i&shy;mum_ob&shy;ject_size 16384 KB

ac&shy;cess_log /var/log/squid3/ac&shy;cess.log squid

shut&shy;down_life&shy;time 1 sec&shy;ond

acl lo&shy;cal-servers dst 127.0.0.1 192.168.1.0/24
nev&shy;er_di&shy;rect deny lo&shy;cal-servers
nev&shy;er_di&shy;rect al&shy;low all
</code></pre>

<p>There are two &#8220;par&shy;ent&#8221; prox&shy;ies in this file which this per&shy;son&shy;al proxy can ac&shy;cess. Ob&shy;vi&shy;ous&shy;ly, re&shy;place <code>user&shy;name</code> and <code>pass&shy;word</code> with your own au&shy;then&shy;ti&shy;ca&shy;tion in&shy;for&shy;ma&shy;tion. Al&shy;so, don&#8217;t for&shy;get to change <code>cache_ef&shy;fec&shy;tive_user</code> and <code>cache_ef&shy;fec&shy;tive_group</code> to your lik&shy;ing or your dis&shy;tro. Change the <code>cache_re&shy;place&shy;ment_pol&shy;i&shy;cy</code> to fit your caching needs, and fi&shy;nal&shy;ly, make sure to ed&shy;it the <code>acl lo&shy;cal-servers</code> to spec&shy;i&shy;fy which servers you do not want to proxy.</p>

<p>After do&shy;ing this, you should be able to restart Squid and have ev&shy;ery&shy;thing work&shy;ing! Next up: trans&shy;par&shy;ent prox&shy;y&shy;ing with ipt&shy;a&shy;bles.</p>
]]></content:encoded>
			<wfw:commentRss>http://nongraphical.com/2008/09/squid-3-proxy-chaining/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.918 seconds -->
