Configure Squid on Linux to Provide a Proxy and Network Caching

Squid is a proxy and caching server. Also, it works with content filters like SquidGuard to implement black lists that are used to block requests to undesirable web sites.


This article is stale and missing pertinent information. However, it is in the process of being updated.

Important Files and Folders

File/Folder Purpose
/etc/squid3/squid.conf Squid configuration file
/var/log/squid/access.log Squid access log file (on Ubuntu)


Change the default configuration by editing /etc/squid3/squid.conf.

Configure the devices / subnet allowed access.

	acl localnet src
	http_access allow localnet

Find the http_port tag. By default it is set to port 3128. This is the port that Squid will listen to for requests. You will also need to set this port in your browser when you configure the browser's proxy.

Since our application is multi-homed, we need to specify that squid listens on only the green zone subnet:


Running Squid

Once installed, Squid will run on boot. Squid can be restarted by:

	$ sudo service squid3 restart

If you make changes to squid.conf or later reconfigure SquidGuard, you can run a reconfigure:

	$ sudo squid -k reconfigure

You can view squid activity on an Ubuntu installation at /var/log/squid3/access.log. If configured for native format, each line will be written as shown below. Further information on the log format can be found here.

	time elapsed remotehost code/status bytes method URL rfc931 peerstatus/peerhost type


Please help us improve this article by adding your comment or question:

email addresses are neither displayed nor shared