This tutorial helps you to install Squid proxy server on your Debian 9 Stretch system. Also provide basic configuration details of the Proxy server to allow traffic, restrict specific websites with keyword or domain names.

Step 1 – Install Squid on Debian

Login to your Debian 9 system using root or sudo privileges user. Then run the following commands on the console to install Squid on Debian 9 system from the default package repository.

Step 2 – Configure Squid Port

Squid default runs on port 3128. It is your choice to keep running squid on default port or change it to some different port. To change port edit squid configuration file and changehttp_port value. /etc/squid/squid.conf After making changing let’s restart Squid service to reload the configuration changes

Step 3 – Allow All Traffic

Sometimes you are required to allow all traffic on your proxy server. In Squid server open Squid configuration file. Comment the http_access deny all line and add the http_access allow all entry this file.

Step 4 – Block Specific Website with Squid

Let’s start with the additional configuration like blocking any website using squid proxy server. Add below rules to block specific website before any allow all rules. Below example will block yahoo.com and www.rediff.com. If you have a long list of domain names, Create a file /etc/squid/blockwebsites.lst and put domain names one per line and add below rule in the squid configuration file. blockwebsites.lst file content example:

Step 5 – Block Specific Keyword with Squid

Add below rules to block specific website before any allow all rules. Below example will block all pages having keyword yahoo or Gmail. If you have a long list of keywords, Create a file /etc/squid/blockkeywords.lst and put keywords one per line and add below rule in the squid configuration file. blockkeywords.lst file content example: Congratulation’s you have successfully install and configured Squid proxy server. Read next article to Configure Squid for Mac Address Based Filtering.

How to Install and Configure Squid Proxy on Debian Linux   TecAdmin - 93