{"id":3953,"date":"2012-09-24T23:24:08","date_gmt":"2012-09-24T15:24:08","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3953"},"modified":"2023-07-20T09:39:31","modified_gmt":"2023-07-20T09:39:31","slug":"how-to-setup-squid-proxy-server-on-linux-centos-6-3","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-setup-squid-proxy-server-on-linux-centos-6-3\/","title":{"rendered":"How to Setup Squid Proxy Server on Linux CentOS 6.3"},"content":{"rendered":"<p>In server optimization, <a href=\"https:\/\/webhostinggeeks.com\/blog\/squid-proxy-server-features-functions-benefits\/\">Squid<\/a> plays two primary roles:<\/p>\n<ul>\n<li>acts as a caching <a href=\"https:\/\/webhostinggeeks.com\/blog\/proxy-server-definition-functionality-types\/\">proxy server<\/a>, standing between the user and the web, thereby enhancing the efficiency and speed of web requests;<\/li>\n<li>serves as a content accelerator or <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-reverse-proxy\/\">reverse proxy<\/a>, intercepting requests to a server and using a cached version of the page to serve the request. <\/li>\n<\/ul>\n<p>This tutorial will guide you through the process of setting up a Squid 3 Proxy Server on CentOS 6.3.<\/p>\n<p>For a deeper understanding of web servers, you can explore our comprehensive guides on the <a href=\"https:\/\/webhostinggeeks.com\/best\/web-server\/\">best web servers<\/a>. If you&#8217;re interested in other server types like <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, or <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a>, we&#8217;ve got you covered.<\/p>\n<h2>Step 1: Install Squid<\/h2>\n<p>The first step in setting up a Squid Proxy Server on CentOS 6.3 is to install Squid. This can be done using the &#8216;yum install&#8217; command as shown below:<\/p>\n<pre>\r\n[root@centos63 ~]# yum install squid -y\r\n<\/pre>\n<p>This command will install Squid on your CentOS 6.3 system.<\/p>\n<pre>\r\n[root@centos63 ~]# yum install squid -y\r\nLoaded plugins: fastestmirror, presto, priorities\r\nLoading mirror speeds from cached hostfile\r\n * base: centos.ipserverone.com\r\n * extras: centos.ipserverone.com\r\n * updates: centos.ipserverone.com\r\nCentOS6.3-Repository                                                         | 4.0 kB     00:00 ...\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package squid.i686 7:3.1.10-9.el6_3 will be installed\r\n--> Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n====================================================================================================\r\n Package             Arch               Version                         Repository             Size\r\n====================================================================================================\r\nInstalling:\r\n squid               i686               7:3.1.10-9.el6_3                updates               1.7 M\r\n\r\nTransaction Summary\r\n====================================================================================================\r\nInstall       1 Package(s)\r\n\r\nTotal download size: 1.7 M\r\nInstalled size: 5.7 M\r\nDownloading Packages:\r\nSetting up and reading Presto delta metadata\r\nProcessing delta metadata\r\nPackage(s) data still to download: 1.7 M\r\nsquid-3.1.10-9.el6_3.i686.rpm                                                | 1.7 MB     00:14\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing : 7:squid-3.1.10-9.el6_3.i686                                                      1\/1\r\n  Verifying  : 7:squid-3.1.10-9.el6_3.i686                                                      1\/1\r\n\r\nInstalled:\r\n  squid.i686 7:3.1.10-9.el6_3\r\n\r\nComplete!\r\n<\/pre>\n<h2>Step 2: Configure Squid Configuration File<\/h2>\n<p>Next, you need to configure the main Squid configuration file. You can use the &#8216;vi&#8217; command to edit the file:<\/p>\n<pre>\r\n[root@centos63 ~]# vi \/etc\/squid\/squid.conf\r\n<\/pre>\n<h2>Step 3: Add Internal Network Name<\/h2>\n<p>In this step, you will add your internal network name into the IP networks list where browsing should be allowed. For instance, if your internal network name is &#8216;ehowstuff&#8217;, you would add it as shown below:<\/p>\n<pre>\r\nacl localnet src 10.0.0.0\/8 # RFC1918 possible internal network\r\nacl localnet src 172.16.0.0\/12 # RFC1918 possible internal network\r\nacl localnet src 192.168.0.0\/16 # RFC1918 possible internal network\r\nacl localnet src fc00::\/7 # RFC 4193 local private network range\r\nacl localnet src fe80::\/10 # RFC 4291 link-local (directly plugged) machines\r\nacl ehowstuff src 192.168.1.0\/24 # Your internal network\r\n<\/pre>\n<h2>Step 4: Allow Browsing for Your Network<\/h2>\n<p>Next, you need to add your network (in this case, &#8216;ehowstuff&#8217;) to the ACL section list of IP networks where browsing should be allowed:<\/p>\n<pre>\r\nhttp_access allow localnet\r\nhttp_access allow localhost\r\nhttp_access allow ehowstuff\r\n<\/pre>\n<h2>Step 5: Set Squid Proxy Port<\/h2>\n<p>Ensure that the Squid proxy port is uncommented. You can change the proxy port to any available port. By default, Squid listens to port 3128:<\/p>\n<pre>\r\nhttp_port 3128\r\n<\/pre>\n<h2>Step 6: Start Squid Service<\/h2>\n<p>Now that Squid is configured, you can start the Squid service using the following command:<\/p>\n<pre>\r\n[root@centos63 ~]#service squid start\r\n<\/pre>\n<p>You should see a response indicating that the Squid service has started successfully.<\/p>\n<h2>Step 7: Configure Proxy Setting at Client\u2019s Browser<\/h2>\n<p>The final step is to configure the proxy setting at the client&#8217;s browser. This process will vary depending on the browser you are using, but you will need to enter the IP address of your Squid server and the port number (3128 by default) into your browser&#8217;s proxy settings.<\/p>\n<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/09\/Squid-server-settings.png\" alt=\"Squid server settings\" width=\"384\" height=\"339\" class=\"alignnone size-full wp-image-16519 img-fluid lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/09\/Squid-server-settings.png 384w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/09\/Squid-server-settings-300x265.png 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/09\/Squid-server-settings-128x113.png 128w\" data-sizes=\"(max-width: 384px) 100vw, 384px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 384px; --smush-placeholder-aspect-ratio: 384\/339;\" \/><\/p>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">yum install squid -y<\/span> \u2013 This command installs Squid on your CentOS 6.3 system.<\/li>\n<li><span class=\"fw-bold\">vi \/etc\/squid\/squid.conf<\/span> \u2013 This command opens the main Squid configuration file for editing.<\/li>\n<li><span class=\"fw-bold\">service squid start<\/span> \u2013 This command starts the Squid service.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Setting up a Squid Proxy on CentOS 6.3 is a straightforward process that involves installing Squid, configuring the main Squid configuration file, adding your internal network name, allowing browsing for your network, setting the Squid proxy port, starting the Squid service, and configuring the proxy setting at the client&#8217;s browser.<\/p>\n<p>By following the steps outlined in this tutorial, you can successfully set up a Squid Proxy Server and enhance the efficiency and speed of your web requests. Remember, if you need more information on web servers, you can always refer to our guides on the <a href=\"https:\/\/webhostinggeeks.com\/best\/web-server\/\">best web servers<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a>.<\/p>\n<p>For different types of hosting, you can explore our articles on <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud hosting<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-shared-hosting\/\">shared hosting<\/a>.<\/p>\n<p>Remember, the key to a successful web server setup lies in understanding the process and following the steps carefully.<\/p>\n<p>Happy hosting!<\/p>\n<h2>FAQ<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is a Squid Proxy Server?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">A Squid Proxy Server is a tool that primarily acts as a caching proxy server, standing between the user and the web, thereby enhancing the efficiency and speed of web requests. Additionally, it serves as a content accelerator or reverse proxy, intercepting requests to a server and using a cached version of the page to serve the request.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the purpose of the &#8216;yum install squid -y&#8217; command?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The &#8216;yum install squid -y&#8217; command is used to install Squid on your CentOS 6.3 system.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the &#8216;service squid start&#8217; command do?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The &#8216;service squid start&#8217; command is used to start the Squid service on your system.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the default port for Squid?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The default port for Squid is 3128.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I configure the proxy setting on my client&#8217;s browser?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The process will vary depending on the browser you are using, but you will need to enter the IP address of your Squid server and the port number (3128 by default) into your browser&#8217;s proxy settings.<\/span>\n            <\/p>\n<p><\/<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In server optimization, Squid plays two primary roles: acts as a caching proxy server, standing between the user and the web, thereby enhancing the efficiency and speed of web requests;&#8230;<\/p>\n","protected":false},"author":6,"featured_media":2471,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1057],"tags":[1254,1536,1678,1793],"class_list":["post-3953","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-squid-server","tag-centos-6-3","tag-linux","tag-proxy","tag-squid"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=3953"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/2471"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=3953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}