Installing Squid Proxy using Webmin on Ubuntu Server 8.04.1
This tutorial will go over installing Squid using Webmin to configure it. We won’t be going over installing Webmin, so if you need help there is an excellent tutorial at HowtoForge. You’re going to want to install Squid first so that Webmin will automatically detect that you have Squid installed and install the correct modules. Don’t worry though, if you already have webmin installed, you can add the Squid module from the Webmin admin area.
There are two ways to install Squid. You can either install it from source by downloading it at the Squid website, or you can use aptitude. We will go over using aptitude to install. To install Squid using aptitude type the following command:
This will download and install the needed dependencies. Now install Webmin using the tutorial above. Next you need to login to webmin. It should be something like https://<your IP address>:<port> with the IP address being the IP address of the machine that webmin was installed on and the port that you assigned it during the setup.
Once you have logged in, on the left you will see “Servers.” Click on that and then click on “Squid Proxy Server.” You may need to fill out some information such as the correct paths for your Squid install. Once you have done that, you will be able to configure Squid through Webmin.
Click on “Ports and Networking” and note what the port is that Squid will be using (default: 3128). This is the port that you will need to enter on your browser in order to use Squid. Then return to the Squid Module Index and click on the “Access Control” button.
At the bottom there is a button called “Create new ACL.” Before you click on that, select “Client Address” from the drop down box next to the button. Now click on the button. On this page, you are going to to fill in the following information:
– From IP: the first IP allowed to use Squid. For example, you can type in 192.168.1.0 and that will allow all IP’s that start with 192.168.1.
– To IP: Enter the last IP allowed, or you can again use 192.168.1.0
– Netmask: Enter your subnet mask (255.255.255.0)
Click Save. This will return you to the Access Control screen. Click on “Proxy restrictions” at the top. Now click Add proxy restriction. Click the allow button next to Action, and highlight “home_network,” or whatever you named your ACL above. Click Save.
You will now see your new entry at the bottom of the list. On the right hand side click the up arrow to move your new ACL to where it is above the line that the action is “Deny” and the ACLs is all. (Should be one move) At the very top of the screen click on “Apply Changes.” Then return to the main Squid Proxy Server Page. Click on Stop Squid, allow it to stop, and then click on Start Squid.
You have now completed the setup for Squid on your server. We now need to allow the port you assigned to Squid to pass your firewall. If you are using iptables, add the following line to your iptables:
Now we need to setup your desktop browser to use Squid.
For Firefox open your Preferences, click on Advanced, then the Network tab. Open Settings.Click the Manual proxy configuration button. Under HTTP Proxy add the IP address of your Squid Proxy Server, and then add the correct Port number (default: 3128). Click Use this proxy server for all protocols. In the No Proxy for box, type:
You also want to add the IP address for the server that your Webmin and Squid is on. You can also add other sites if you like.Click Ok and Close to get back to the browser.
For Internet Explorer open up your Internet Preferences dialog, select the Connections tab, and open LAN settings. Click the box next to Use a proxy server for your LAN, enter the correct IP address and port. Click on Bypass proxy server for local addresses. If you have more addresses that you don’t want to use the proxy server on, click advanced and enter them at the bottom. Click Ok, and Ok.
Your proxy server should now be working!