This article will help you to set up Squid Proxy Server on Ubuntu 18.10, 18.04 LTS, 16.04 LTS, and 14.04 LTS systems.

Step 1 – Install Package

Squid packages are available in default yum repositories. Execute the below command on your server to install the SQUID proxy server.

Step 2 – Configure Squid Port

The default port for the Squid proxy servers is 3128. You can change this as per the requirements. To set up Squid on different port, Edit squid configuration file and change http_port value with new port. After making changes let’s restart the Squid service to reload the configuration changes The next steps will help you to set up Squid Proxy Server on Ubuntu systems. Use only those settings, which is required for your proxy server.

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 a squid proxy server. Add below rules to block specific websites before any allow all rules. The 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 the 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 websites before any allow all rules. The below example will block all pages having the 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 the 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 Setup Squid Proxy Server on Ubuntu 18 04   16 04   TecAdmin - 32