{"id":532,"date":"2019-02-12T05:14:02","date_gmt":"2019-02-12T05:14:02","guid":{"rendered":"http:\/\/linuxresellerwebhosting.in\/blog\/?p=532"},"modified":"2019-02-13T02:05:00","modified_gmt":"2019-02-13T02:05:00","slug":"how-to-install-squid-proxy-server-on-cent-os","status":"publish","type":"post","link":"https:\/\/linuxresellerwebhosting.in\/blog\/how-to-install-squid-proxy-server-on-cent-os\/","title":{"rendered":"How to Install SQUID Proxy Server on Cent OS"},"content":{"rendered":"\n<p>\nSquid is the most popular Proxy server for Linux systems. It also used \nfor the web filtering. Its widely used for increasing web server speed \nby caching repeated data.\n\n<\/p>\n\n\n\n<p>\nThis article will help you to Install and Configure SQUID Proxy Server on CentOS, Redhat and Fedora Linux systems.\n\n<\/p>\n\n\n\n<p>\nSquid packages are available in default yum repositories. Execute below command on your server to install SQUID proxy server.\n\n<\/p>\n\n\n\n<p># yum install squid<\/p>\n\n\n\n<p> Squid default runs on port <strong>3128<\/strong>. If you want to start squid on different port, Edit squid configuration file and change <strong>http_port<\/strong> value. For example we are changing squid to run on port <strong>8080<\/strong>.  <br><strong>\/etc\/squid\/squid.conf<\/strong> <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">http_port 8080<\/pre>\n\n\n\n<p>\nAfter making changing let\u2019s restart Squid service to reload the configuration changes\n\n<\/p>\n\n\n\n<p># systemctl restart squid<\/p>\n\n\n\n<p> Let\u2019s start with the additional configuration like blocking any website  using squid proxy server. Add below rules to block specific website  before any allow all rules. Below example will block google.com and  facebook.com. <\/p>\n\n\n\n<p>acl blocksite1 dstdomain google<br>\nacl blocksite2 dstdomain facebook.com<br>\nhttp_access deny blocksite1<br>\nhttp_access deny blocksite2<\/p>\n\n\n\n<p>\nIf you have a long list of domain names, Create a file <strong>\/etc\/squid\/blockwebsites.lst<\/strong> and put domain names one per line and add below rule in squid configuration file.\n\n<\/p>\n\n\n\n<p><strong>blockwebsites.lst<\/strong> file content example:\n\n<\/p>\n\n\n\n<p># cat \/etc\/squid\/blockwebsites.lst  <br>google.com<br>facebook.com <\/p>\n\n\n\n<p> Add below rules to block specific website before any allow all rules.  Below example will block all pages having keyword yahoo or Gmail. <br><\/p>\n\n\n\n<p>acl blockkeyword1 url_regex yahoo<br>\nacl blockkeyword2 url_regex gmail<br>\nhttp_access deny blockkeyword1<br>\nhttp_access deny blockkeyword2<\/p>\n\n\n\n<p>\nIf you have a long list of keywords, Create a file <strong>\/etc\/squid\/blockkeywords.lst<\/strong> and put keywords one per line and add below rule in squid configuration file.\n\n<\/p>\n\n\n\n<p>acl blockkeywordlist url_regex &#8220;\/etc\/squid\/blockkeywords.lst&#8221;<br>\nhttp_access deny blockkeywordlist<\/p>\n\n\n\n<p>blockkeywords.lst file content example: <\/p>\n\n\n\n<p>cat \/etc\/squid\/blockkeywords.lst<\/p>\n\n\n\n<p>yahoo<br>\ngmail<br>\nfacebook<\/p>\n\n\n\n<p>Congrats !!! you have successfully installed Squid proxy Server \ud83d\ude42<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Squid is the most popular Proxy server for Linux systems. It also used for the web filtering. Its widely used<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[1],"tags":[],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":1,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":533,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/532\/revisions\/533"}],"wp:attachment":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}