How to Install the proxy with squid on Ubuntu Serveur 20.04

Squid is a well-known application in the forward proxy world and works well as a caching proxy. It supports HTTP, HTTPS, FTP, and other popular network protocols.

Following are the steps to setup and configure Squid proxy:

Step 1 : First, update the apt cache and then install squid as follows

sudo apt-get update
sudo apt install squid

Step 2 : Edit the /etc/squid/squid.conf file

sudo nano /etc/squid/squid.conf

Ensure that the cache_dir directive is not commented out

cache_dir ufs /var/spool/squid 100 16 256

Optionally, change the http_port directive to your desired TCP port

http_port 8080

Step 3 : Save changes with Ctrl + O and exit with Ctrl + X.

Step 4 : Restart the squid server

sudo service squid restart

Step 5 : Next, configure your browser using the squid server as the http/https proxy

Squid Analysis Report Generator

SARG is an open source tool to monitor the squid server usages. It parses the logs generated by Squid and converts them to easy-to-digest HTML-based reports. You can track various metrics such as bandwidth used per user, top sites, downloads, and so on.

Step 1 : Sarg can be quickly installed with the following command:

sudo apt-get install sarg

Step 2 : The configuration file for Sarg is located at /etc/sarg/sarg.conf

cat /etc/sarg/sarg.conf

Squid guard

Step 1 : Squid guard is another useful plugin for squid server. It is generally used to block a list of websites so that these sites are inaccessible from the internal network. As always, it can also be installed with a single command, as follows:

sudo apt-get install squidguard

Step 2 : The configuration file is located at /etc/squid/squidGuard.conf

cat /etc/squid/squidGuard.conf

Add Comment