How to install and configure Squid Proxy Server on OpenSUSE leap 42.1

To install and Squid Proxy Server on OpenSUSE leap 42.1

Squid is a caching proxy server that caches frequently visited websites and reduces the Internet bandwidth. It works on almost all operating systems which also includes Windows and is licensed under the GNU GPL. Squid is capable of caching various kinds of Web objects, including those accessed through HTTP and FTP. Another usage of Squid is distributing a single internet connection to multiple users. In this tutorial, you will learn about the method to install and configure Squid Proxy Server.

Installing Squid

You can trigger the installation of Squid in your OpenSUSE machine by running the following command.

linuxhelp1:~ # zypper in squid

Loading repository data...
Warning: Repository ' openSUSE-Leap-42.1-Update'  appears to be outdated. Consider using a different mirror or server.
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  squid

1 new package to install.
Overall download size: 2.4 MiB. Already cached: 0 B. After the operation
.
.
.
etrieving: squid-3.3.14-12.1.x86_64.rpm ...................[done (319.7 KiB/s)]
Checking for file conflicts: .............................................[done]
(1/1) Installing: squid-3.3.14-12.1 ......................................[done]

linuxhelp1:~ # systemctl start squid
linuxhelp1:~ # systemctl enable squid

The installation is now complete, but you still need to configure it and we are going to see about it in the next step.


To configure squid

In order to configure Squid, you need to open the squid.conf file located in /etc/squid/. After opening it create acl rule inside the configuration. Use the following command for the same purpose.

linuxhelp1:~ # vim /etc/squid/squid.conf
acl test src 192.168.7.216
acl block dstdomain " /etc/squid/block.text" 
http_access deny test block
http_access allow test

Before that create “ block.text” file in /etc/squid/ file path

linuxhelp1:~ # vim /etc/squid/block.text



Now restart your squid service.

linuxhelp1:~ # systemctl restart squid

Now switch to your browser and type the domains which are listed.

Those domains are blocked.

You can use this configuration method for the purpose of caching unwanted web content.


Tag : Squid OpenSUSE
FAQ
Q
How do I register my cache with NLANR's registration service?
A
Just enable these options in your squid.conf and you'll be registered:

cache_announce 24
announce_to sd.cache.nlanr.net:3131
Q
Where can I get Squid?
A
You can download Squid via FTP from the primary FTP site or one of the many worldwide mirror sites.
Many sushi bars also have Squid.
Q
Why is it called Squid?
A
Harris' Lament says, ``All the good ones are taken."

We needed to distinguish this new version from the Harvest cache software. Squid was the code name for initial development, and it stuck.
Q
Which file do I download to get Squid?
A
You must download a source archive file of the form squid-x.y.z-src.tar.gz (eg, squid-1.1.6-src.tar.gz) from the Squid home page, or. the Squid FTP site. Context diffs are available for upgrading to new versions. These can be applied with the patch program
Q
What kind of compiler do I need?
A
To compile Squid, you will need an ANSI C compiler. Almost all modern Unix systems come with pre-installed compilers which work just fine. The old SunOS compilers do not have support for ANSI C, and the Sun compiler for Solaris is a product which must be purchased separately.