Let's have a look at the files and directories generated during installation. The easiest way to checkout the directories and files generated is to use the tree
command. If the tree
command is not available, we can list files using the ls
command as well.
tree ${prefix} | less
${prefix}
is the directory used with the --prefix
option for configure
. Now let's have a brief overview at the important files generated by Squid during installation. All of the following directories and files listed, reside in ${prefix}
:
This directory contains programs which can be executed or run by a user without root or super user privileges.
squidclient
is a HTTP client with advanced capabilities, which allow it to tinker HTTP requests to test the Squid server. Run squidclient
to checkout the available options:
${prefix}/bin/squidclient
This is the default location for the Squid configuration file. The squid.conf
generated during installation is the bare minimum configuration required for Squid to be used. We always make changes to this file if we need to alter the Squid configuration.
Squid generates this default configuration file so that we can copy and rename it to squid.conf
and start afresh.
This is a fully documented version of squid.conf
, containing thousands of lines of comments. We should always refer to this file for the available configuration tags for the version of Squid when we have installed.
This directory contains programs which can only be executed by a user with root or super user privileges.
This directory contains localized error page templates. The templates are HTML pages and we can customize the error messages displayed by Squid, by modifying these HTML templates.
This is the place where the man
pages for squid
, squidclient
, and helpers are built during compilation. Man
pages are manual or help pages which can be viewed using the command man
(available on all Linux/Unix distributions). To view a man
page located at /opt/squid/share/man/man8/squid.8
, we can use the man
command as follows:
man /opt/squid/share/man/man8/squid.8
For more details about man pages, please visit http://en.wikipedia.org/wiki/Man_page.
This is the default home for all the log files (such as cache.log
, access.log
, and so on) used by Squid.
We have just looked at the various files and directories generated during installation and a had brief overview of what each directory contains.
Squid binary packages are available in the software repositories of most operating systems and we can install them by using the package managers provided by the respective operating systems. Next, we'll see how to use a package manager on a few operating systems to install Squid.
Note
The latest or beta versions may not be available in software repositories of all the operating systems. In such cases, we should get the latest or beta versions from the Squid website, as explained earlier in this chapter.
Yum is a popular package manager on RPM-based operating systems. Squid RPM is available in the Fedora, CentOS, and Red Hat repositories. To install Squid, we can simply use the following command:
yum install squid
Squid is available in the FreeBSD ports collection. The following command can be used to install Squid on FreeBSD:
pkg_add -r squid31
For more information on package management in FreeBSD, please go to http://www.freebsd.org/doc/handbook/packages-using.html.
Installing Squid on OpenBSD or NetBSD is similar to installing it on FreeBSD and can be performed using the following command:
pkd_add squid31
To learn more about the package management system in OpenBSD and NetBSD, please refer to http://www.openbsd.org/ports.html#Get and http://www.netbsd.org/docs/pkgsrc/using.html#installing-binary-packages respectively.
To install Squid on Dragonfly BSD, we can use the following command:
pkg_radd squid31
For more information on installing binary packages on Dragonfly BSD, please visit http://www.dragonflybsd.org/docs/newhandbook/pkgsrc/.
To install Squid on Arch Linux, we can use the package manager pacman
, as shown in the following command:
pacman -S squid
For more information on pacman
, please visit https://wiki.archlinux.org/index.php/Pacman.
Which of the following web documents can't be cached by a proxy server?
A HTML page
A JPEG image
A PHP script that produces output based on a client's IP Address
A JavaScript file
In which of the following scenarios, should we worry about the
--enable-diskio
option?Caching in RAM (main memory) is enabled
Caching on hard disk is enabled
Caching is disabled
None of the above
When does a removal policy selection affect the overall Squid performance?
If caching is disabled
If caching on the hard disk and RAM is enabled
A removal policy selection is not related to caching
A removal policy doesn't affect overall Squid performance