the web and send the HTTP request. Instead, they connect to the local proxy
server. The proxy then forwards their requests on to the web, retrieves the
result, and hands it back to the client. At its simplest, a proxy server really is
just an extra layer between client and server, so why bother?
The three main reasons for deploying a proxy server are as follows:
Content control—You want to prevent access to certain types of
content.
Speed—You want to cache common sites to make the most of your
bandwidth.
Security—You want to monitor what people are doing.
Squid accomplishes these things and more.
Installing Squid
You can easily install Squid as usual from the Ubuntu software repositories,
where it is called squid. After Squid is installed, it is automatically enabled
for each boot. You can check that it is by running ps aux | grep squid
when the machine boots. If you see nothing there, run sudo start
squid.
Configuring Clients
Before you configure your new Squid server, set up the local web browser to
use it for its web access. Doing so enables you to test your rules as you are
working with the configuration file.
To configure Firefox, while Firefox is running in the foreground, select
Preferences from the Edit menu from the top panel of the Ubuntu desktop. In
the dialog that appears, select the Advanced settings using the icon in the top
row, and within Advanced, select the Network tab. Then click the Settings
button next to Configure How Firefox Connects to the Internet and select the
Manual Proxy Configuration option. Check the box beneath it, labeled Use
the Same Proxy for All Protocols. Enter 127.0.0.1 in the HTTP Proxy box
and 3128 as the port number. See Figure 36.1 for how this should look. If
you are configuring a remote client, specify the IP address of the Squid server
rather than 127.0.0.1.