How to install and configure squid on RedHat 8.5
To Install And Configure Squid on REDHAT 8.5
Introduction
A proxy server is a system or router that acts as a gateway between users and the Internet. As a result, it prevents cyber attackers from entering a private network. Essentially, it is a server that acts as an intermediary between end-users and the web pages they visit online. Squid is a full-featured web proxy cache server application that connects to Hyper Text Transport Protocol (HTTP), File Transfer Protocol (FTP), and other popular protocols to provide proxy and cache services.
Installation procedure:
Step 1 : Check the Installed version of OS by using the below command
[root@linuxhelp /]# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.5 (Ootpa)"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.5"
Step 2 : Install the squid by using the below command
[root@linuxhelp /]# yum install squid*
Updating Subscription Management repositories.
Unable to read consumer identity
Installing:
squid x86_64 7:4.15-1.module+el8.5.0+11469+24c223d9 1 3.6 M
perl-Digest-SHA x86_64 1:6.02-1.el8 1 66 k
Transaction Summary
==============================================
Install 3 Packages
Is this ok [y/N]: y
Complete!
Step 3 : Allow HTTP access by using the below command
[root@linuxhelp /]# vim /etc/squid/squid.conf
:set nu in this case line number 63
# And finally deny all other access to this proxy
http_access allow all
Step 4 : Create the block list of the sites by using the below command
[root@linuxhelp /]# vi /blocklist.txt
www.facebook.com
www.amazon.com
Step 5 : Open the configuration file and create some rules by using the below command
[root@linuxhelp /]# vi /etc/squid/squid.conf
:set nu in this case line number 51 to 54
iprange src 192.168.6.0/24
acl site dstdomain "/blocklist.txt"
http_access deny iprange site
http_access allow iprange
Step 6 : Enable the squid services by using the below command
[root@linuxhelp /]# systemctl enable squid
Created symlink /etc/systemd/system/multi-user.target.wants/squid.service → /usr/lib/systemd/system/squid.service.
Step 7 : Start the squid services by using the below command
[root@linuxhelp /]# systemctl start squid
Step 8 : Check the status of squid server by using the below command
[root@linuxhelp /]# systemctl status squid
● squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-04-15 11:45:21 IST; 11s ago
Step 9 : Check the IP address by using the below command
[root@linuxhelp /]# ip addr
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 inet 192.168.6.121/23 brd 192.168.7.255 scope global noprefixroute ens160
Step 10 : Go to your favorite browser, set proxy and check the links as shown in the below images
set proxy
By this to install and configure squid on REDHAT 8.5 has been completed