How To Install and Configure Squid Server on Linux Debian 11.3
To Install and Configure Squid Server on Linux Debian 11.3
Introduction:
A proxy server acts as a gateway between the user and the internet and is used to restrict websites and browsers from particular users.
Step 1: Check the OS version by using the below command
root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Step 2: Once the OS version is checked, now install the squid server by using the below command
root@linuxhelp:~# apt-get install squid
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
The following NEW packages will be installed:
After this operation, 15.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Processing triggers for ufw (0.36-7.1) ...
Rules updated for profile 'OpenSSH'
Firewall reloaded
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...
Step 3: After the squid is installed, now start the squid service by using the below command
root@linuxhelp:~# systemctl start squid
Step 4: After the squid service is started. Check the status of the squid service by using the below command
root@linuxhelp:~# systemctl status squid
● squid.service - Squid Web Proxy Server
Loaded: loaded (/lib/systemd/system/squid.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-06-23 23:40:24 IST; 5s ago
Docs: man:squid(8)
Process: 35570 ExecStartPre=/usr/sbin/squid --foreground -z (code=exited, status=0/SUCCESS)
Main PID: 35573 (squid)
Tasks: 4 (limit: 6156)
Memory: 15.8M
CPU: 228ms
CGroup: /system.slice/squid.service
├─35573 /usr/sbin/squid --foreground -sYC
├─35575 (squid-1) --kid squid-1 --foreground -sYC
├─35576 (logfile-daemon) /var/log/squid/access.log
└─35577 (pinger)
Jun 23 23:40:24 linuxhelp squid[35575]: Adaptation support is off.
Jun 23 23:40:24 linuxhelp squid[35575]: Accepting HTTP Socket connections at local=[::]:3128 remote=[::] F>
Jun 23 23:40:24 linuxhelp systemd[1]: Started Squid Web Proxy Server.
Jun 23 23:40:25 linuxhelp squid[35575]: storeLateRelease: released 0 objects
Step 5: After the squid server status is checked. Let configure some rules using squid.conf file by using the below command
root@linuxhelp:~# vi /etc/squid/squid.conf
#INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
include /etc/squid/conf.d/*
acl newlist src 192.168.6.127
acl blok dstdomain "/etc/squid/block.txt"
http_access deny newlist blok
http_access allow newlist
#Example rule allowing access from your local networks.
#Adapt localnet in the ACL section to list your (internal) IP networks
#from where browsing should be allowed
#http_access allow localnet
http_access allow localhost
Step 6: After the configuration is complete. Let configure block.txt by using the below command
root@linuxhelp:~# vi /etc/squid/block.txt
google.com
Step 7: After the configuration is complete, now reload the squid service by using the below command
root@linuxhelp:~# service squid reload
Step 8: Open the setting on browser and Click the network setting option as shown in the below image


Step 9: Configure Proxy Access to the Internet. Enter the Google.com, the site is blocked by squid proxy service. Enter into the Instagram, this page will be allowed by the squid server.



Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to install and configure Squid server on Linux Debian 11.3. Your feedback is much welcome.
Comments ( 0 )
No comments available