Mind Chasers Inc.
Mind Chasers Inc.

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.

advertisement

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)

Configuration

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

Configure the devices / subnet allowed access.

	acl localnet src 192.168.1.0/24
	
	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:

	http_port 192.168.1.1:3128

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

References

Didn't find an answer to your question? Post your issue below or in our new FORUM, and we'll try our best to help you find a solution.

And please note that we update our site daily with new content related to our open source approach to network security and system design. If you would like to be notified about these changes, then please follow us on Twitter and join our mailing list.

share
subscribe to mailing list:

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

For enhanced features and capabilities, please sign in or authenticate using a popular third party

your email address will be kept private

to upload an image

previous month
next month
Su
Mo
Tu
Wd
Th
Fr
Sa
loading