Jack Wallen demonstrates how to set up a Squid proxy server through the web-based Webmin administration tool.
A proxy server can prevent employees from visiting certain sites, help reduce the load on your network by caching pages for clients, and make use of SSL to secure connections between clients and servers. Many smaller companies assume they don’t have the time or the money to put into setting up a proxy server. Thanks to Webmin, that is not the case.
With the Webmin administration portal, you can easily set up a Squid proxy server and manage that proxy with the user friendly web-based administration tool. I will walk you through the steps of setting up a Squid proxy server through the Webmin tool. I will demonstrate this on a Ubuntu 12.10 platform and do everything through the web-based GUI (no command-line necessary). Because Squid is designed to run on UNIX-like systems (there was a Windows port for a brief period, but it was abandoned), you need to have Webmin running on a UNIX-based system. Once you have Webmin up and running, you are very close to having Squid installed.
In order to be able to enable the Squid module, Squid needs to be installed; fortunately, Webmin is smart enough to handle this task for you. After you log in to Webmin as an administrator, you can have Webmin install Squid and then enable the module for you. Here’s how:
Figure A
When the installation completes, refresh the view of your Webmin portal and then expand the Servers section. You should now see a listing for Squid Proxy Server (Figure B). Click the Squid Proxy Server, and you’re ready to start setting it up.
Figure B
The first thing you will see is the error “Your Squid cache directory /var/spool/squid3 has not been initialized. This must be done before Squid can be run.” In order to initialize this, click the Initialize Cache button (with either an existing user, or you can create a new user/group “proxy”). At this point you will see the “Stopping Squid” warning. Once the system has been initialized, you will be prompted with the Return To Squid Index link. If you continue seeing this error, here’s what you need to do:
Your plan for using the proxy will dictate how you configure it. Regardless of how you use it, you will want to define the ports used by the proxy first. By default, Squid uses 3128. You can stick with the default, or if you need to go with a non-standard port, here’s how to change it:
You can set Squid to listen to more than one port by going back into Ports And Network and adding a new port.
Figure C
By default, Squid will listen to requests coming from all addresses. You can set this on a per-address or per-hostname basis by entering the IP address or hostname under the Hostname/IP Address column in the table.
Let’s say you want to block Facebook using Squid. You must first create a new Access Control List (ACL), which you can do by following these steps:
Figure D
Now you have to create a Proxy Restriction. Here’s how:
Figure E
Back at the module index, click Apply Changes to restart Squid with the newly created restrictions.
You should now have a proxy set up to block all access to Facebook (I’m not advocating this practice, just using it as an example). You can apply this same idea to nearly anything you’d like to block. And remember, Squid can be used for a lot more than blocking domains.