WEBVTT

00:00:01.040 --> 00:00:03.760
Welcome to this demo clip, setting up Squid.

00:00:04.440 --> 00:00:07.050
In this clip, you'll see how to download Squid,

00:00:07.840 --> 00:00:12.860
how to build Squid from source, and how to start Squid using Docker.

00:00:13.540 --> 00:00:14.460
Let's get started.

00:00:14.840 --> 00:00:18.570
So first things first, you'll want to head over to Squid's website,

00:00:18.660 --> 00:00:23.560
squid‑cache.org. From here, you can click on the Download button.

00:00:25.040 --> 00:00:28.490
This takes you to Squid's download page from which you can download

00:00:28.500 --> 00:00:30.160
every available version of Squid.

00:00:30.640 --> 00:00:36.310
You'll want to grab the latest stable version of Squid here. From

00:00:36.310 --> 00:00:42.220
this page, we can go ahead and download the source code. If you don't

00:00:42.220 --> 00:00:45.230
want to build from source, binaries are available for a number of

00:00:45.230 --> 00:00:48.820
different distributions. Now that we have the source code, let's see

00:00:48.820 --> 00:00:53.100
how we can build Squid from source so that we can begin to use it. In

00:00:53.100 --> 00:00:53.680
this course,

00:00:53.680 --> 00:00:55.900
we've selected to use Docker in order to make

00:00:55.900 --> 00:00:57.760
building and running Squid very easy.

00:00:58.440 --> 00:01:02.180
Let's take a look at our Dockerfile. We'll be using a stable version of

00:01:02.180 --> 00:01:05.250
Ubuntu as our operating system and base image here.

00:01:06.140 --> 00:01:08.790
Now we set some environment variables including the

00:01:08.790 --> 00:01:13.820
SQUID_VERSION, and a bit further down, the caching and log

00:01:13.820 --> 00:01:17.130
directories that Squid will use. Here, we copy in the

00:01:17.130 --> 00:01:19.160
downloaded source code that we grabbed earlier.

00:01:20.340 --> 00:01:22.460
Now here are the really important bits.

00:01:22.940 --> 00:01:25.760
First, we install the needed dependencies to build Squid.

00:01:26.340 --> 00:01:31.950
As you can see, we need to C/C++ compiler, in this case, gcc and make.

00:01:32.640 --> 00:01:37.300
Now, we need to run the configure script found within the Squid source

00:01:37.300 --> 00:01:41.520
code to prepare Squid for building. The configure script has a number of

00:01:41.520 --> 00:01:44.190
different options that we can take advantage of when it comes to

00:01:44.190 --> 00:01:46.460
customizing your specific build of Squid.

00:01:46.940 --> 00:01:51.650
And finally, we run make install to install Squid. For a full listing of

00:01:51.650 --> 00:01:54.260
instructions on how to build Squid on several different operating

00:01:54.260 --> 00:01:57.380
systems and for a listing of available options,

00:01:57.390 --> 00:02:04.600
check out this URL. Now, we can set the script we want to run on startup

00:02:04.610 --> 00:02:07.650
and expose the port that we would like Squid to run on.

00:02:08.740 --> 00:02:12.950
If we check out this entrypoint.sh file really quickly, we

00:02:12.950 --> 00:02:16.690
can see that it simply starts Squid, passing in the path to

00:02:16.690 --> 00:02:18.660
the appropriate squid.conf file.

00:02:19.440 --> 00:02:22.750
Now we can run docker build to build the image.

00:02:23.740 --> 00:02:27.540
This may take a while if it's your first time running this command, as Squid

00:02:27.540 --> 00:02:30.460
is being built from source and it's a rather large project.

00:02:31.140 --> 00:02:32.400
Once that's complete,

00:02:32.660 --> 00:02:38.820
we can run a container based on this new image we've created. And as you

00:02:38.820 --> 00:02:42.560
can see, Squid is running within this container. Awesome.

00:02:43.240 --> 00:02:45.670
This is a start. In the next demo,

00:02:45.670 --> 00:02:49.340
we'll actually learn about how to configure Squid, an important step if

00:02:49.340 --> 00:02:51.390
we're going to learn how to take advantage of the different

00:02:51.390 --> 00:02:54.550
authentication and access controls that Squid provides.
