07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11.6. HTTP/FTP Proxy<br />

An HTTP/FTP proxy acts as an intermediary for HTTP and/or FTP connections.<br />

twofold:<br />

Its role is<br />

• Caching: recently downloaded documents are copied locally, which avoids multiple<br />

downloads.<br />

• Filtering server: if use of the proxy is mandated (and outgoing connections are blocked<br />

unless they go through the proxy), then the proxy can determine whether or not the<br />

request is to be granted.<br />

Falcot Corp selected Squid as their proxy server.<br />

11.6.1. Installing<br />

The squid Debian package only contains the modular (caching) proxy. Turning it into a filtering<br />

server requires installing the additional squidguard package. In addition, squid-cgi provides a<br />

querying and administration interface for a Squid proxy.<br />

Prior to installing, care should be taken to check that the system can identify its own complete<br />

name: the hostname -f must return a fully-qualified name (including a domain). If it does<br />

not, then the /etc/hosts file should be edited to contain the full name of the system (for instance,<br />

arrakis.falcot.com). The official computer name should be validated with the network<br />

administrator in order to avoid potential name conflicts.<br />

11.6.2. Configuring a Cache<br />

Enabling the caching server feature is a simple matter of editing the /etc/squid/squid.conf<br />

configuration file and allowing machines from the local network to run queries through the<br />

proxy. The following example shows the modifications made by the Falcot Corp administrators:<br />

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS<br />

# Example rule allowing access from your local networks. Adapt<br />

# to list your (internal) IP networks from where browsing should<br />

# be allowed<br />

acl our_networks src 192.168.1.0/24 192.168.2.0/24<br />

http_access allow our_networks<br />

http_access allow localhost<br />

# And finally deny all other access to this proxy<br />

http_access deny all<br />

Example 11.30<br />

The /etc/squid/squid.conf file (excerpts)<br />

286 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!