{"id":450,"date":"2013-11-26T20:54:23","date_gmt":"2013-11-26T20:54:23","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=450"},"modified":"2013-11-26T20:54:23","modified_gmt":"2013-11-26T20:54:23","slug":"install-squid-proxy-centos-6","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2013\/11\/26\/install-squid-proxy-centos-6\/","title":{"rendered":"How To Install Squid Proxy on CentOS 6"},"content":{"rendered":"<h3>Step 1 &#8211; Spin up a CentOS 6.3 x64 droplet<\/h3>\n<hr \/>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/assets.digitalocean.com\/articles\/community\/CentOS6-Squid1.png\" width=\"680\" \/><\/p>\n<h3>Step 2 &#8211; Install Squid<\/h3>\n<hr \/>\n<pre>yum -y install squid\nchkconfig squid on<\/pre>\n<h3>Step 3 &#8211; Setup Access Restrictions<\/h3>\n<hr \/>\n<p>Since this Squid proxy would allow anyone using it to make connections from your droplet&#8217;s IP address, you would want to restrict access to it.<\/p>\n<p>You can register a free dynamic IP from services like noip.com<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/assets.digitalocean.com\/articles\/community\/DynDNSClient1.png\" width=\"680\" \/><\/p>\n<p>If you would like to use this Squid proxy from your phone, you would have to install a dynamic DNS update client.<\/p>\n<p>You can use applications like\u00a0<i>Dynamic DNS Client for Android<\/i>, or\u00a0<i>FreeDynPro for iOS<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/assets.digitalocean.com\/articles\/community\/DynDNSClient2.png\" width=\"680\" \/><\/p>\n<p>Once you have a dynamic IP hostname, you can update it from your router at home, mobile device, or an API call.<\/p>\n<p>This hostname should be added to\u00a0<b>\/etc\/squid\/squid.conf<\/b>. Edit the file and add your hostname (nyproxy1.no-ip.org in our case):<\/p>\n<pre>acl localnet src nyproxy1.no-ip.org<\/pre>\n<p>Setup a crontab that reloads Squid every hour, in case your IP address changes:<\/p>\n<pre>echo 0 *\/1 * * * service squid reload &gt;&gt; \/var\/spool\/cron\/root<\/pre>\n<h3>Step 4 &#8211; Configure Squid Proxy<\/h3>\n<hr \/>\n<p>By default, Squid listens on port 3128. If you would like to use a different port, modify<b>\/etc\/squid\/squid.conf<\/b><\/p>\n<pre>http_port 3128<\/pre>\n<p>If you would like to browse through this Squid proxy and not have it detected as a proxy, setup anonymous settings by adding these lines to\u00a0<b>\/etc\/squid\/squid.conf<\/b>:<\/p>\n<pre>via off\nforwarded_for off\n\nrequest_header_access Allow allow all \nrequest_header_access Authorization allow all \nrequest_header_access WWW-Authenticate allow all \nrequest_header_access Proxy-Authorization allow all \nrequest_header_access Proxy-Authenticate allow all \nrequest_header_access Cache-Control allow all \nrequest_header_access Content-Encoding allow all \nrequest_header_access Content-Length allow all \nrequest_header_access Content-Type allow all \nrequest_header_access Date allow all \nrequest_header_access Expires allow all \nrequest_header_access Host allow all \nrequest_header_access If-Modified-Since allow all \nrequest_header_access Last-Modified allow all \nrequest_header_access Location allow all \nrequest_header_access Pragma allow all \nrequest_header_access Accept allow all \nrequest_header_access Accept-Charset allow all \nrequest_header_access Accept-Encoding allow all \nrequest_header_access Accept-Language allow all \nrequest_header_access Content-Language allow all \nrequest_header_access Mime-Version allow all \nrequest_header_access Retry-After allow all \nrequest_header_access Title allow all \nrequest_header_access Connection allow all \nrequest_header_access Proxy-Connection allow all \nrequest_header_access User-Agent allow all \nrequest_header_access Cookie allow all \nrequest_header_access All deny all<\/pre>\n<h3>Step 5 &#8211; Start Squid proxy service<\/h3>\n<hr \/>\n<pre>service squid start<\/pre>\n<h3>Step 6 &#8211; Modify your browser&#8217;s proxy settings<\/h3>\n<hr \/>\n<p>Add your droplet&#8217;s IP address and port to your browser&#8217;s proxy settings.<\/p>\n<h3>Step 7 &#8211; Verify Squid proxy works<\/h3>\n<hr \/>\n<p>Navigate over to\u00a0<a href=\"http:\/\/www.whatismyip.com\/\">whatismyip.com<\/a><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/assets.digitalocean.com\/articles\/community\/CentOS6-Squid4.png\" width=\"680\" \/><\/p>\n<p>And you are all done!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1 &#8211; Spin up a CentOS 6.3 x64 droplet Step 2 &#8211; Install Squid yum -y install squid chkconfig squid on Step 3 &#8211; Setup Access Restrictions Since this Squid proxy would allow anyone using it to make connections from your droplet&#8217;s IP address, you would want to restrict access to it. You can [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[60],"tags":[161],"class_list":["post-450","post","type-post","status-publish","format-standard","hentry","category-linux","tag-how-to-install-squid-proxy-on-centos-6"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=450"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/450\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}