Monthly Archives: July 2017

Squid Web Caching Proxy configuration on Ubuntu or Linux Mint


Optimising Web Delivery

Squid is an excellent caching proxy for the Web. It supports HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems.

Installation

To install squid on Ubuntu or Linux mint, enter the following command in the terminal.

sudo apt-get install squid squid-common

Following command can be used to check the logs.

sudo tail -f /var/log/squid/access.log

Squid can also be used as an adblocker tool.

Disable ads using Squid

Squid has the ability to read a list of IPs from a text file and block those IPs from clients using the proxy. Your clients in turn will not have to be bothered with ads.

The following lines need to be added anywhere in your squid.conf file which is usually located in /etc/squid/ and you will be putting your list of ad servers called adBlock.txt in the same directory.

Please note: You can copy hosts from here and paste into your adBlock.txt file. Remove the IPs from the left side of the file and only keep the list of domain names.

## disable ads
acl blockAds dstdom_regex "/etc/squid/adBlock.txt"
http_access deny blockAds

Once it is done, restart the Squid service by entering following command:

sudo service squid restart

Now configure network setting in your browser to use the manual proxy. On Firefox, It will look like:

Squid-Proxy-Firefox-Setup

Remember that default port used by Squid is 3128. It can be configured and changed from the Squid.conf file.

Here is the official link for more details: http://www.squid-cache.org