A year ago, I was able to obtain a used (end-of-lease) skid of 20 IBM ThinkPad T22 notebooks. I was able to sell almost all of them on eBay (after cleaning them up, buying RAM and power adaptor cords), except for two (because the hardware does not work properly). Those two have been laying around (gathering dust) ever since. I’m reluctant to throw the last two out, because some of the parts can be salvaged. I scavenged both units, in order to make one that is somewhat usable. After booting-up, I found the screen starts to flicker and then “go wild” after some time. Needless to say, I’ll never be able to use or auction this as a “working” laptop.
The unit has a 20GB hard drive in it, so that did not make it much of a storage location. Assuming laptops use less power power hungry than desktops, and that it has a very small footprint, I thought it would be a good idea to install Ubuntu with Squid. (Leaving me with a spare 800MHz CPU and some RAM). If like me, you enjoy hands-on learning, you’ll probably find this post usefull.
I do have other posts about speeding up your Internet surfing here:
Speed Up Your Internet Connection in Ubuntu Linux - Part 1.
Speed Up Your Internet Connection in Ubuntu Linux - Part 2.
Speed Up Web Browsing by Caching DNS to Your Hard Drive in Ubuntu.
Squid can be used as a proxy caching server to improve the speed of my Internet connection (and reduce network traffic). This would be a great solution for dial-up users as well. Additionally, after further reading, I also learned that it also caches Domain Name Server (DNS) lookups (which further improves web surfing speed).
Because this is an older laptop (with only 256MB RAM), I decided an earlier version (6.06LTS - Dapper) of Ubuntu would work nicely. I headed over to: http://www.ubuntu.com/getubuntu/download. And downloaded the “Ubuntu 6.06 LTS - Supported to 2011” for “Standard personal computer (x86 architecture, PentiumTM, CeleronTM, AthlonTM, SempronTM)”, which according to that download page says, “The “LTS” version of Ubuntu receives long-term support. 3 years for desktop versions and 5 years for server versions.”
Once I had a burned image of the CD, I began by installing the server (booting off the CD). Not a LAMP install, just a base server. In my case I followed the prompts for a default server installation.
While following along, I named the server (hostname) “squid”. Not too original, I know, but at least it tells me what this unit is when I look on the network. In my case, during the “Partition Disks” section, I selected “Erase entire disk and use LVM: IDE1 master (hda) - 20.0 GB IBM-DJ”, because there was nothing of value on that hard drive. (The screen has not started to flicker yet, so I’m in luck…).
The following partitions were created, so I simply went along with those defaults:
“partition #5 of IDE1 master (hda) as ext3″
“partition #1 of LVM VG Ubuntu, LV root as ext3″
“partition #1 of LVM VG Ubuntu, LV swap_1 as swap”
Continue installing; just follow along and answer any prompts.
Now I’m ready for squid, what are the dependancy packages? You can find that information here: http://packages.ubuntu.com/dapper-updates/web/squid
But these are installed automatically when you install squid.
Instead of typing “sudo” in each command (when logging in after the reboot), just “sudo su” and that will apply for the rest of the commands entered.
First thing is to update the repositories:
vi /etc/apt/sources.list
and place a # in front of the “deb cdrom: [Ubuntu-Server…” line. (That way apt will not try to use the CD). vi commands are here: http://www.cs.rit.edu/~cslab/vi.html if you need them. I also added
“universe” and “multiverse” to all sources.list directives.
apt-get update
apt-get upgrade
Reboot using:
reboot
Login and “sudo su”.
I hate being hunched in over trying to work on a system where the screen is not working properly. Time to install SSH:
apt-get install ssh openssh-server
And we need a static IP address:
vi /etc/network/interfaces
Mine now looks like this:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet static
address 172.18.1.2
netmask 255.255.255.0
network 172.18.1.0
broadcast 172.18.10.255
gateway 172.18.1.10
To get your new (static) settings to function, restart the network:
/etc/init.d/networking restart
When you get the “* Reconfiguring network interfaces… [ok]” message, just make sure the settings are correct:
ifconfig
The remainer can be completed remotely (in comfort). Just log off
exit
exit
I can now connect remotely via SSH using PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/).
Side note: If you are interested in other useful open source packages, take a peek here: Top 100 of the Best (Useful) OpenSource Applications.
I tried to connect via SSH (PuTTY) but could not. A restart of SSH:
/etc/init.d/ssh start
did not work so:
reboot
(Then Login and “sudo su” if you rebooted).
Install squid packages:
apt-get install squid squid-common
We need to edit the Squid configuration file so that it works, but…
Before doing anything with the squid configuration, make a backup!
cp /etc/squid/squid.conf /etc/squid/squid.conf.backup
Now let’s start editing the Squid configuration…
Note: Make sure you “sudo su” or you will be denied access to restart squid or edit squid.conf If you restart without having “sudo su’ed” you’ll get an error. (And I found out the squid.conf file will look lke it’s empty when you use vi).
vi /etc/squid/squid.conf
I changed the following:
cache_mem 76 MB
(The physical RAM in this unit is 256MB). If you’d like to tweak more of the directives, there’s a great resource here: http://www.squid-cache.org/Versions/v2/2.6/cfgman/
restart squid:
/etc/init.d/squid restart
Figuring I was done, I configured Firefox to use my spiffy new Squid server and tried to access the web: http://ubuntulinuxhelp.com gave me this:
=========================================
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: http://ubuntulinuxhelp.com/
The following error was encountered:
* Access Denied.
Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.
Your cache administrator is webmaster.
Generated Sat, 01 Mar 2008 18:20:06 GMT by squid.localdomain (squid/2.5.STABLE12)
=========================================
It appears weve still got work to do, evidently this must be an access issue? Let’s look:
vi /etc/squid/squid.conf
and go to the section that starts with “# ACCESS CONTROLS”
When you read that section, like me, you’ll realize that Squid appears to be only allowing access via localhost connections. We need to fix that. Look a bit further down and you will see text that begins with “INSERT YOUR OWN RULE…” and “Example rule allowing access from local networks…”.
Under:
http_access allow localhost
I added:
acl my_network src 172.18.1.0/24
http_access allow my_network
There’s an example of this entry in the notes (within the squid.conf file), just read them and you’ll see how this came about. Of course you won’t use “my_network” as you’ll probably have a different idea.
Now I have access! Web surfing works!
The goal was to speed up web surfing, therefore we need to make sure that “Transparent Cache/Proxy” is enabled.
To do this, add the following (http://www.deckle.co.za/squid-users-guide/Transparent_Caching/Proxy)
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
Now all I have to do is tuck this between a couple books on the shelf (make sure the fan exhaust is not blocked) and enjoy super fast surfing!
Note: Don’t forget, before you sign off, apt-get moo ![]()


1 person has left a comment
[…] Speed Up Your Internet Connection in Ubuntu Linux - Part 1 Speed Up Your Internet Connection in Ubuntu Linux - Part 2 Speed Up Web Browsing by Caching DNS to Your Hard Drive in Ubuntu. Speed Up and Improve Web Surfing With an Ubuntu Squid Server. […]