Squid

From LinuxMCE
Jump to: navigation, search

Squid is a proxy which caches images on websites for later retrieval, thereby saving bandwidth. I have a slow internet connection (Even though I work for an ISP!) and this application speeds up my web surfing no end. Even if you have plenty of bandwidth to spare, it's useful to keep your browsing speed up while you're downloading or streaming.

Squid is also HIGHLY configurable. I wont go into that here, as it's OOB functionality should be enough to get you going for now. If you want further information, check out their website

Here are the steps required to get it working:

1. Go to your KDE desktop and start a terminal session using konsole or your favourite terminal program.

2. Enter the command "sudo aptitude install squid".

3. Enter the command "sudo update-rc.d squid defaults".

OK, so squid is now on your system. To check it is running type "pgrep squid" into your console, and it should give you a number (this is not important). If the previous command doesn't output anything, enter "sudo /etc/init.d squid start" into your console. You should get a message in the console indicating squid has started ok. If not, have a look at the logs in /var/log/squid/ and have a look at this page

Now, assuming squid is up and running (as I said, it worked OOB for me), we need to modify the squid configuration file so it's allow access to your local network. Please note that my network setup is the suggested one (i.e. an external interface for my ADSL, and an internal interface for my LAN). So....

4. Using your favourite text editor, open up /etc/squid3/squid.conf (you'll need root privileges for this)(below using default network settings)

5. Find the "acl localhost src" line and insert the following line below: "acl dcerouterlocalnet src 192.168.80.0/24"

6. Find the following line: # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

7. Under the line is one that reads "http_access allow localhost". Below this you need to insert a line allowing your local LAN; "http_access allow dcerouterlocalnet. Now save the file, and exit.

8. Into your console type "sudo /etc/init.d/squid restart". You should get a message that squid has restarted successfully

Now all that's left to do is configure your client:

Firefox 3 (For Linux)

1. Click on Edit menu, then Preferences. 2. In the preferences dialog box click on advanced, then on the advanced tab click the Settings button 3. Click the radio button for "Manual proxy configuration" 4. Next to HTTP Proxy enter the IP of your core (192.168.80.1 for me) and the port that squid runs on is 3128 by default 5. Squid can also be used as an FTP and SSL proxy, however I wont go into that here

Internet Explorer 7

1. Click on the tools menu, or the tools button on the right-hand side at the top, and click on "Internet Options" 2. In the tools dialog box, click on the Connections tab, then click on the LAN settings button towards the bottom. 3. Tick the box that says "Use a proxy server for your LAN", and then enter the IP address of your Core(192.168.80.1 for me), and squids port which is 3128

There! Thats everything done. Once you 'ok' those settings you should be ready to rock! Try browsing to any page. At this point you may get an 'access denied' error from the squid server, in which case you probably haven't added your ACL's correctly, please re-read step number 6.

Further Work Hoping to get squid added into the default installation, to be controlled via the admin portal, and also made transparent which would negate the need to change any browser settings. Working on this now....