Simple step by step guide to install and configure SQUID proxy server in RHEL/Centos/Oracle linux (5/6/7)


Simple  step by step guide to install and configure SQUID proxy server  in RHEL/Centos/Oracle linux (5/6/7)

In this tutorial we learn what is SQUID proxy server and how to configure SQUID proxy server in linux .

What is SQUID Proxy

SQUID is most popular proxy server in linux operating system which is used to filter the web traffic and acts as cache server to boost up speed of web server.

Install SQUID proxy server in RHEL/Centos/Oracle linux

To install the SQUID proxy server we need to install squid package in the linux system . to install this package we execute the below command.

[root@localhost ~]# yum install squid
====================================================
 Package                 Arch     Version
====================================================
Installing:
 squid                   x86_64   7:3.1.23-24.el6
Installing for dependencies:
 libtool-ltdl            x86_64   2.2.6-15.5.el6
 perl                    x86_64   4:5.10.1-144.el6
 perl-DBI                x86_64   1.609-4.el6
 perl-Module-Pluggable   x86_64   1:3.90-144.el6
 perl-Pod-Escapes        x86_64   1:1.04-144.el6
 perl-Pod-Simple         x86_64   1:3.13-144.el6
 perl-libs               x86_64   4:5.10.1-144.el6
 perl-version            x86_64   3:0.77-144.el6

Transaction Summary
====================================================
Install       9 Package(s)

How to change SQUID port

By default squid is running on pot 3128. If we want to change the squid port we need to open squid configuration file “/etc/squid/squid.conf”  and change the http_port parameter .

Suppose we want to change the port 8080 instead of 3128 we need to change the value of http_port to 8080.

Allow http access for all using SQUID proxy

To allow http access for all using squid we need to change the below line.

http_access allow all
instead of
http_access deny all

Block the specific website using SQUID proxy

To block the specific website using squid proxy we need to add the below lines into the squid configuration file. suppose we want to block google.com using SQUID proxy  we add following lines.

acl blocksite dstdomain www.google.com
http_access deny blocksite

Simple  step by step guide to install and configure SQUID proxy server  in RHEL/Centos/Oracle linux (5/6/7)
Simple  step by step guide to install and configure SQUID proxy server  in RHEL/Centos/Oracle linux (5/6/7)


Block large no of websites using SQUID proxy


To block large no of website we need to create a file called blocksitelist under the directory “/etc/squid” and add all block website list into this file and add the following line into the squid config file.

#cd /etc/squid
#echo google.com yahoo.com facebook.com >> blocksitelist
#vi /etc/squid/squid.conf
acl blocksitelist dstdomain “/etc/squid/blocksitelist”
http_access deny blocksitelist

That’s all if this article is helpful please share it.

SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 comments:

  1. Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! 13377x

    ReplyDelete