{"id":4362,"date":"2013-02-20T21:57:44","date_gmt":"2013-02-20T13:57:44","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4362"},"modified":"2023-07-04T12:50:33","modified_gmt":"2023-07-04T12:50:33","slug":"how-to-setup-squid-on-centos-5-9","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-setup-squid-on-centos-5-9\/","title":{"rendered":"How to Setup Squid Proxy Service on CentOS 5.9"},"content":{"rendered":"<p>In this guide, we&#8217;ll walk you through the process of setting up a Squid Proxy Server on CentOS 5.9.<\/p>\n<p><a href=\"https:\/\/webhostinggeeks.com\/blog\/squid-proxy-server-features-functions-benefits\/\">Squid<\/a> is a caching <a href=\"https:\/\/webhostinggeeks.com\/best\/proxy-servers\/\">proxy server<\/a> for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator.<\/p>\n<p>This tutorial will cover the basic installation and configuration of Squid and how to deploy web filtering applications to save bandwidth and speed up web access.<\/p>\n<h2>Step 1: Installing Squid Proxy Server<\/h2>\n<p>The first step in setting up a Squid Proxy Server on CentOS 5.9 is to install the Squid package. This can be done by issuing the following command:<\/p>\n<pre>\r\n[root@centos59 ~]# yum -y install squid\r\n<\/pre>\n<p>This command will install the Squid package along with its dependencies. The &#8220;-y&#8221; option in the command allows yum to proceed with the installation without asking for confirmation.<\/p>\n<p>Example:<\/p>\n<pre>\r\n[root@centos59 ~]# yum -y install squid\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * base: mirror.nus.edu.sg\r\n * extras: mirror.nus.edu.sg\r\n * updates: mirror.nus.edu.sg\r\nbase                                                                         | 1.1 kB     00:00\r\nextras                                                                       | 2.1 kB     00:00\r\nupdates                                                                      | 1.9 kB     00:00\r\nupdates\/primary_db                                                           | 103 kB     00:00\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package squid.i386 7:2.6.STABLE21-6.el5 set to be updated\r\n--> Processing Dependency: perl(URI::URL) for package: squid\r\n--> Running transaction check\r\n---> Package perl-URI.noarch 0:1.35-3 set to be updated\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                i386               7:2.6.STABLE21-6.el5                base             1.3 M\r\nInstalling for dependencies:\r\n perl-URI             noarch             1.35-3                              base             116 k\r\n\r\nTransaction Summary\r\n====================================================================================================\r\nInstall       2 Package(s)\r\nUpgrade       0 Package(s)\r\n\r\nTotal download size: 1.4 M\r\nDownloading Packages:\r\n(1\/2): perl-URI-1.35-3.noarch.rpm                                            | 116 kB     00:00\r\n(2\/2): squid-2.6.STABLE21-6.el5.i386.rpm                                     | 1.3 MB     00:11\r\n----------------------------------------------------------------------------------------------------\r\nTotal                                                               111 kB\/s | 1.4 MB     00:12\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing     : perl-URI                                                                     1\/2\r\n  Installing     : squid                                                                        2\/2\r\n\r\nInstalled:\r\n  squid.i386 7:2.6.STABLE21-6.el5\r\n\r\nDependency Installed:\r\n  perl-URI.noarch 0:1.35-3\r\n\r\nComplete!\r\n<\/pre>\n<h2>Step 2: Configuring Squid<\/h2>\n<p>Once the Squid package is installed, the next step is to configure it. This involves editing the main Squid configuration file. You can use the &#8216;vi&#8217; editor to do this. Here are the configurations you need to set:<\/p>\n<p>Define the allowed network:<\/p>\n<pre>\r\nacl webhostinggeeks-dev3 src 192.168.2.0\/24\r\n<\/pre>\n<p>Allow the defined network:<\/p>\n<pre>\r\nhttp_access allow webhostinggeeks-dev3\r\n<\/pre>\n<p>Set the port that Squid listens to (default is 3128):<\/p>\n<pre>\r\nhttp_port 3128\r\n<\/pre>\n<p>Set the visible hostname:<\/p>\n<pre>\r\nvisible_hostname centos59.webhostinggeeks-dev3.local\r\n<\/pre>\n<h2>Step 3: Starting Squid Service<\/h2>\n<p>After configuring Squid, the next step is to start the Squid service. This can be done by issuing the following command:<\/p>\n<pre>\r\n[root@centos59 ~]# service squid start\r\n<\/pre>\n<p>This command will start the Squid service. If the service starts successfully, you should see an &#8220;[ OK ]&#8221; message.<\/p>\n<pre>\r\n[root@centos59 ~]# service squid start\r\nStarting squid: .                                          [  OK  ]\r\n<\/pre>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">yum -y install squid<\/span> \u2013 This command installs the Squid package along with its dependencies.<\/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 Server on CentOS 5.9 is a straightforward process that involves installing the Squid package, configuring it, and starting the service.<\/p>\n<p>This guide has provided step-by-step instructions on how to do this. By following these steps, you can set up a Squid Proxy Server to help reduce bandwidth usage, speed up web access, and cache web, name server query, and other network lookups.<\/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 Squid used for?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Squid is primarily used as a proxy and caching agent for HTTP, HTTPS, and FTP protocols. It helps in reducing bandwidth usage and improving response times by caching and reusing frequently-requested web pages.<\/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 install Squid on CentOS 5.9?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can install Squid on CentOS 5.9 by using the command &#8216;yum -y install squid&#8217;. This command will install the Squid package along with its dependencies.<\/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 Squid on CentOS 5.9?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can configure Squid on CentOS 5.9 by editing the main Squid configuration file. This involves defining the allowed network, allowing the defined network, setting the port that Squid listens to, and setting the visible hostname.<\/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 start the Squid service on CentOS 5.9?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can start the Squid service on CentOS 5.9 by using the command &#8216;service squid start&#8217;. This command will start the Squid service.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What are the benefits of using a Squid Proxy Server?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">A Squid Proxy Server can help in reducing bandwidth usage and improving response times by caching and reusing frequently-requested web pages. It can also be used to speed up a web server by caching repeated requests, and for caching web, name server query, and other network lookups.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we&#8217;ll walk you through the process of setting up a Squid Proxy Server on CentOS 5.9. Squid is a caching proxy server for the Web supporting HTTP,&#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":[2055],"tags":[1250,1536,1678,1793],"class_list":["post-4362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-5-9","tag-linux","tag-proxy","tag-squid"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4362","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=4362"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4362\/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=4362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}