Step 1 – Install Squid on Debian 8

Login to your Debian 8 system using root or sudo privileges user. Then run the following commands on the console to install Squid on Debian 8 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

Assuming you need a proxy server open to all, Then you need to allow all traffic on your proxy server. Edit the Squid configuration file and Comment the http_access deny all line. Then add the http_access allow all entry this file.

Step 4 – Block Specific Website with Squid

Here you want to block some specific websites through the proxy server. Then add the following rules to block specific website just before the allow all rule. Below example will block yahoo.com and www.rediff.com. If you have a large number of domain names, then 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

You can also block websites for specific keywords. Add the following rules just before the allow all rule. Below is the example of blocking all pages having keyword yahoo or Gmail. If you have a large number of keywords to block then 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 8   TecAdmin - 17