Barra de espaço
Barra de espaço

This tutorial describes a detailed procedure showing how to perform the installation of the Squid proxy cache service on a computer running Ubuntu or Debian operating system 

 

YOUTUBE

In our channel you can view the video of this tutorial.

 



Date & Time

Follow the steps shown in the video tutorial below to configure the correct date & time on your system.

 

This will make your reports and logs have the correct time.

Install Basic Compilers, necessary for further installation.

# apt-get install build-essential



INSTALLATION

Create a group and a user named squid who will own the service process


# groupadd squid
# useradd -g squid -s /dev/null squid

Download and extract Squid.

# mkdir /downloads
# cd /downloads
# wgethttp://www.squid-cache.org/Versions/v3/3.4/squid-3.4.6.tar.gz
# tar -zxvf squid-3.4.6.tar.gz

Install squid using the commands below.

# cd squid-3.4.6
# ./configure 
# make
# make install

Edit the configuration file.

# vi /usr/local/squid/etc/squid.conf

Here is a functional configuration file.

http_port 3128
coredump_dir /usr/local/squid/var/cache/squid
cache_dir ufs /usr/local/squid/var/cache/squid 100 16 256
access_log daemon:/usr/local/squid/var/logs/access.log squid
cache_effective_user squid
acl INTERNAL_NETWORK src 192.168.0.0/24
http_access allow INTERNAL_NETWORK
http_access deny all

 

The file above specify that only the internal network 192.168.0.0/24 have access to the Internet through Squid allowed.
(Change this policy to your desired network)

The file above specify that only 100 MB are used for caching.
(Change this policy to the amount of cache in megabytes you want)

When finished editing the configuration file, create the directories where the cache and logs will be stored through the following commands:

# mkdir /usr/local/squid/var/cache

# mkdir /usr/local/squid/var/logs
# chown squid.squid /usr/local/squid/ -R
# /usr/local/squid/sbin/squid -z

Start the proxy in debug mode to see if we are cool.

# /usr/local/squid/sbin/squid -d10

If errors are not displayed, your proxy has been successfully installed.

SQUID Management


Use the following command to stop the Squid service:

# /usr/local/squid/sbin/squid -k kill

Use the following command to start the Squid service:

# /usr/local/squid/sbin/squid

CONCLUSion

This tutorial presented the Squid service installation process.