How to provide access for users using Squid Proxy Server in FreeBSD

To provide access for users using Squid Proxy Server in FreeBSD

Squid is an internet content filtering application which supports caching of many different kinds of Web objects, including those accessed through HTTP and FTP. In this tutorial, you' ll learn about the method to provide access for users using Squid.

To know about the installation of Squid, check out the following links.

Squid installation in FreeBSD https://www.linuxhelp.com/how-to-install-squid-proxy-server-on-freebsd/

Squid installation in CentOS https://www.linuxhelp.com/how-to-install-and-configure-squid-part-1

To provide access for users

Before starting the procedure to provide access, check your system for the presence of squid. Use the following command for the same command.

root@linuxhelp1:~ # service squid status
squid is running as pid 1426.

Once you' ve checked, move Squid configuration directory by running the following command.

root@linuxhelp1:~ # cd /usr/local/etc/squid/
root@linuxhelp1:/usr/local/etc/squid # ls -l
total 380
-rw-r--r--   1 root  wheel     692 Jan 12 19:09 cachemgr.conf
-rw-r--r--   1 root  wheel     692 Jan 12 19:09 cachemgr.conf.sample
-rw-r--r--   1 root  wheel    1817 Jan 12 19:09 errorpage.css
-rw-r--r--   1 root  wheel    1817 Jan 12 19:09 errorpage.css.sample
drwxr-xr-x  48 root  wheel    4608 Feb  8 17:25 errors
drwxr-xr-x   3 root  wheel     512 Feb  8 17:25 icons
-rw-r--r--   1 root  wheel   30844 Jan 12 19:09 mib.txt
-rw-r--r--   1 root  wheel   12077 Jan 12 19:09 mime.conf
-rw-r--r--   1 root  wheel   12077 Jan 12 19:09 mime.conf.sample
-rw-r--r--   1 root  wheel    2460 Feb 10 11:47 squid.conf
-rw-r--r--   1 root  wheel  291312 Jan 12 19:09 squid.conf.documented
-rw-r--r--   1 root  wheel    2315 Jan 12 19:09 squid.conf.sample

Open the squid.conf file to add the client ip and block file path.

root@linuxhelp1:/usr/local/etc/squid # nano squid.conf

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

acl test src 192.168.7.216          
acl block dstdomain " /root/Desktop/domainblock.txt"   
http_access deny test block   
http_access allow test  

Once it is done, check the squid service status

root@linuxhelp1:/usr/local/etc/squid # service squid status
squid is running as pid 1426.


Now, reload the Squid service by running the following command.

root@linuxhelp1:/usr/local/etc/squid # service squid reload
Performing sanity check on squid configuration.
Configuration for squid passes.

Next configure the proxy settings on your client machine, enter the proxy server ip with port number.

default port number 3128



Once it is done, open the browser and enable use system proxy on your browser proxy setting.

Now check you internet connection,

And now check blocked sites.


To make sure Squid works well, check other domains too.

FAQ
Q
Does Squid support SSL/HTTPS/TLS?
A
Squid also supports these encrypted protocols by ``tunnelling'' traffic between clients and servers.

The browser opens an SSL connection directly to the origin server.

The browser tunnels the request through Squid with the CONNECT request method.
Q
What is Squid is only dependent on Linux?
A
No, it can be installed and configured on Windows too.
Q
What does the "squid.conf" file will do in "Squid"?
A
The squid.conf file defines the configuration for squid. the configuration includes (but not limited to) HTTP port number, the ICP request port number, incoming and outgoing requests, information about firewall access, and various timeout information.
Q
What is the Squid cache resolution algorithm?
A
The squid cache resolution algorithm are given below,

Send ICP queries to all appropriate siblings

Wait for all replies to arrive with a configurable timeout (the default is two seconds).

Begin fetching the object upon receipt of the first HIT reply, or

Fetch the object from the first parent which replied with MISS (subject to weighting values), or

Fetch the object from the source
Q
What features are Squid developers have currently working on?
A
There are several open issues for the caching project namely more automatic load balancing and (both configured and dynamic) selection of parents, routing, multicast cache-to-cache communication, and better recognition of URLs that are not worth caching.



The current Squid Developers to-do list is available for your reading enjoyment.



Prospective developers should review the resources available at the Squid developers corner