{"id":3766,"date":"2012-08-29T23:21:16","date_gmt":"2012-08-29T15:21:16","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3766"},"modified":"2023-07-04T12:55:10","modified_gmt":"2023-07-04T12:55:10","slug":"how-to-install-squid-on-centos-6-3","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-squid-on-centos-6-3\/","title":{"rendered":"How to Install Squid on CentOS 6.3"},"content":{"rendered":"<p><a href=\"https:\/\/webhostinggeeks.com\/blog\/squid-proxy-server-features-functions-benefits\/\">Squid<\/a> is a popular open-source <a href=\"https:\/\/webhostinggeeks.com\/best\/proxy-servers\/\">proxy server<\/a> that is widely used to improve network performance by caching frequently used web pages. It also helps to increase security and privacy by filtering content and blocking access to malicious websites.<\/p>\n<p>In this short tutorial, we will show you how to install Squid on CentOS 6.3.<\/p>\n<h2>Step 1: Update the System<\/h2>\n<p>Before installing Squid, it&#8217;s essential to update your system to ensure that you have the latest security patches and software updates. To update the system, run the following command:<\/p>\n<pre>\r\nsudo yum update\r\n<\/pre>\n<h2>Step 2: Install Squid<\/h2>\n<p>Once the system is updated, you can proceed to install Squid by running the following command:<\/p>\n<pre>\r\nsudo yum install squid\r\n<\/pre>\n<p>The command will download and install Squid and its dependencies.<\/p>\n<p>Example:<\/p>\n<pre>\r\n[root@centos63 ~]# yum install squid -y\r\nLoaded plugins: fastestmirror, presto\r\nLoading mirror speeds from cached hostfile\r\n * base: mirror1.ku.ac.th\r\n * extras: mirror.yourconnect.com\r\n * updates: mirror1.ku.ac.th\r\nCentOS6.3-Repository                                                         | 4.0 kB     00:00 ...\r\nCentOS6.3-Repository\/primary_db                                              | 3.5 MB     00:00 ...\r\nbase                                                                         | 3.7 kB     00:00\r\nbase\/primary_db                                                              | 3.5 MB     00:31\r\nextras                                                                       | 3.0 kB     00:00\r\nextras\/primary_db                                                            | 6.4 kB     00:00\r\nupdates                                                                      | 3.5 kB     00:00\r\nupdates\/primary_db                                                           | 2.2 MB     00:19\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package squid.i686 7:3.1.10-1.el6_2.4 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-1.el6_2.4             CentOS6.3-Repository           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\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\nWarning: RPMDB altered outside of yum.\r\n  Installing : 7:squid-3.1.10-1.el6_2.4.i686                                                    1\/1\r\n  Verifying  : 7:squid-3.1.10-1.el6_2.4.i686                                                    1\/1\r\n\r\nInstalled:\r\n  squid.i686 7:3.1.10-1.el6_2.4\r\n\r\nComplete!\r\n<\/pre>\n<h2>Step 3: Configure Squid<\/h2>\n<p>After installing Squid, you need to configure it to work correctly. The main configuration file for Squid is located at \/etc\/squid\/squid.conf.<\/p>\n<p>To open the configuration file, run the following command:<\/p>\n<pre>\r\nsudo vi \/etc\/squid\/squid.conf\r\n<\/pre>\n<p>Inside the configuration file, you can set various options such as the listening port, cache size, and access controls. Make sure to save the changes once you&#8217;re done editing the file.<\/p>\n<h2>Step 4: Start and Enable Squid<\/h2>\n<p>Once Squid is configured, you can start and enable it to run automatically at boot time using the following command:<\/p>\n<pre>\r\nsudo systemctl start squid\r\nsudo systemctl enable squid\r\n<\/pre>\n<p>You can verify that Squid is running by checking its status using the following command:<\/p>\n<pre>\r\nsudo systemctl status squid\r\n<\/pre>\n<p>For example:<\/p>\n<pre>\r\n[root@centos63 ~]# systemctl status squid\r\nsquid (pid  11806) is running...\r\n<\/pre>\n<h2>Step 5: Configure Firewall<\/h2>\n<p>If you&#8217;re using a firewall on your system, you need to allow incoming connections to Squid. To do this, run the following command:<\/p>\n<pre>\r\nsudo firewall-cmd --add-service=squid --permanent\r\nsudo firewall-cmd --reload\r\n<\/pre>\n<p>The above commands will allow incoming connections to Squid on the default port 3128.<\/p>\n<h2>Commands Mentioned:<\/h2>\n<ul>\n<li><span class=\"fw-bold\">yum<\/span> &#8211; command-line package management utility for RPM-based Linux systems<\/li>\n<li><span class=\"fw-bold\">systemctl<\/span> &#8211; command-line tool to manage systemd services and units<\/li>\n<li><span class=\"fw-bold\">firewall-cmd<\/span> &#8211; command-line tool to manage firewall rules on RHEL-based systems<\/li>\n<li><span class=\"fw-bold\">vi<\/span> &#8211; command-line text editor<\/li>\n<\/ul>\n<h2>Conclusion:<\/h2>\n<p>In this guide, we have shown you how to install Squid on CentOS 6.3. We started by updating the system, then we installed Squid and configured it to work correctly. We also started and enabled Squid to run automatically at boot time and configured the firewall to allow incoming connections to Squid. By following these steps, you can set up Squid on your CentOS 6.3 system and improve your network performance, security, and privacy.<\/p>\n<p>If you have any comments or suggestions, feel free to leave them below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Squid is a popular open-source proxy server that is widely used to improve network performance by caching frequently used web pages. It also helps to increase security and privacy by&#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,1057],"tags":[1254,1536,1678,1793],"class_list":["post-3766","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","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\/3766","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=3766"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3766\/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=3766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}