How to configure ACL rule for Browser by Squid proxy server in Ubuntu 16.04

To configure ACL rule for Browser by Squid proxy server in Ubuntu 16.04

A proxy server is acts as an intermediary between a end user and the internet and allows a end user to make an indirect connection to network servers and services. A proxy server can help you take control of how users reach the internet. Squid Proxy is mainly used for caching frequently requested web content in order to speed up response time and also save network bandwidth. It supports many different protocols such as HTTP, FTP, TLS, SSL, Internet Gopher and HTTPS. This tutorial covers the configuration procedure of ACL rule for Browser by Squid proxy server in Ubuntu 16.04.

Configuration procedure

To proceed with the installation procedure, install the squid application by running the following command and press y to continue with the installation procedure.

root@linuxhelp11:~# apt-get install squid -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gnome-software-common libgtkspell3-3-0
Use ' sudo apt autoremove'  to remove them.
Suggested packages:
  squidclient squid-cgi squid-purge smbclient winbind
.
.
Processing triggers for man-db (2.7.5-1) ...
Setting up squid (3.5.12-1ubuntu7.4) ...
Skipping profile in /etc/apparmor.d/disable: usr.sbin.squid

The Squid application has been installed successfully. Next update the target machine by running the apt-get update command.

root@linuxhelp11:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [60.4 kB]
.
.
Get:19 http://in.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [4,584 B]
Fetched 3,778 kB in 14s (258 kB/s)                                                     
Reading package lists... Done

Start the squid service by executing the following command.

root@linuxhelp11:~# systemctl start squid

Next open the squid.conf configuration file and edit the squid configuration file using vim editor and enter the following changes in the file. Save and exit the file.

root@linuxhelp11:~# vim /etc/squid/squid.conf
acl test src 192.168.7.104
acl browser_block browser Firefox
http_access deny test browser_block
http_access allow test

Restart the squid proxy server by running the following command.

root@linuxhelp11:~# systemctl restart squid

The configuration process in terminal has been completed. Next open a client machine and set proxy for the machine by opening the internet properties window and select the connection tab menu.

Click the LAN settings on the connections menu.

Set the proxy address and port details and click ok.

To check the internet connections, select the Chrome browser and search for any website. The connections will work properly.

Now check for the same in Firefox browser and the site cannot be accessed in the Firefox due to the proxy connections set by the user.


The configuration procedure of setting ACL rule for browser using Squid Proxy on Ubuntu 16.04 is done successfully.

FAQ
Q
What are the feature available in the Squid?
A
The following features will available in the Squid,
/SquidLogs: writing and most important reading the various squid log files

/SquidMemory describes how squid uses RAM and how to optimize its usage

/SquidAcl (or Authorization): controlling squid's powerful access control features

/ContentAdaptation how to analyze, capture, block, replace, or modify the messages being proxied

/CacheDigests or ICP on steroids

/MiscFeatures: Squid 2.X miscellaneous features
Q
How to install SARG on Ubuntu?
A
For the installation of SARG on Ubuntu, use the following link as given below "https://www.linuxhelp.com/how-to-install-sarg-on-ubuntu-16-04/ "
Q
Which Protocols will support on squid?
A
The HTTP and FTP protocol will supported where squid proxy.
Q
Where to specify a hostname for Squid?
A
For specify the Hostname for squid, configure the following line in the Squid configuration "visible_hostname"
Q
What is default port number of Squid?
A
3128 is a default port number for the Squid proxy server.