
Not so long ago, I had to switch from Reliance’s faster and unreliable ZTE USB modem to Airtel’s slower but more reliable EDGE card (Both USB). The reason for this switch ? -My house being on the Delhi-Faridabad border, keeps switching between states when I had my Reliance data card. Of late ,I’ve also noticed that my Reliance phone goes off the network at night . I hope this was not part of Dhirubhai’s dream… To give them the benefit of doubt,..Maybe their tower does not have sufficient power backup. Nevertheless, when I wake up in the morning, I find my phone “searching for network” with its battery almost flat! I don’t seem to have these problems with the Airtel card as the signal seems to be stronger and more “fade resistant” compared to CDMA. Its not pretty fast, but its faster than those idiotic over heating PCMCIA cards that Airtel pimped a while back -which needed to be pulled out of the slot and reinserted ever so often in the summers as it was very susceptible to heat stroke… but it served its purpose during its reign though, as it was still faster than the GPRS data connection that you you were stuck with when you were out of town and using your mobile phone as a modem. To give you an idea of how slow it is, my desktop has been running for 5 days trying to download a 65Mb ebook and is only 46% done. Thanks to wget’s “-c” option that enables me to resume from where the download fails, or I’d be left downloading that very same book for the rest of my life. I’ve got to give it to Airtel though as their EDGE connection is as stable as a physical wire line. I can’t do anything about my downloads… of course I could SSH to my office server during the night or on holidays and do the same there, but its much more fun to be playing around with our servers and trying various experiments rather than using them to remotely download stuff for me.
The downside of a slow connection is the darned waiting time -especially when you’re researching something and have to open a lot of tabs. After setting up the ebox server on our office, I noticed a spurt in the Internet speeds. This was partly because it had its own DNS server and Proxy Cache and a lot of frequently accessed pages got served locally off the disk. It was also partly because we announced that Internet usage would now be logged and filtered if the bandwidth did not improve
. My usage at home also includes a lot of back and forth browsing and re-accessing the same pages many times over so I started reading up on Squid. I had previously tried increasing the cache on Firefox but was not exactly pleased with the performance increase.
Setting up Squid turned out to be fairly easy and it started working out of the box. I’m using Ubuntu 9.01 (Karmic) so on doing a sudo apt-get install squid, I ended up with squid 2.7 (The syntax for the /etc/squid/squid.conf seems to vary slightly between the versions). Next go to Edit > preferences > Advanced > Network > Settings in Firefox. Select manual proxy configuration and type in 127.0.0.1 and port No 3128 . also select ‘use this proxy server for all protocols” Now check if you can browse the web. If you can, you’re almost there. I’ve also configured the same in System > Preferences > Network Proxy so that the Squid will also cache Ubuntu packages… -This is not strictly necessary as apt also caches downloaded packages -besides Ubuntu can directly connect to the net through your PPP connection, but it helps if you’ve cleared the apt cache and then suddenly find out that you need that package which you just purged! This is mandatory if you setup Squid on an external proxy server and it is not set to transparent mode. Ubuntu did not seem to be able to get updates or packages when it wasn’t set on computers on our office network!
I made some other changes to the configuration, I increased the max object size to approx 1GB (maximum_object_size 1048576 KB ) so that even downloaded ISO’s get cached… cache size to 10Gb (cache_dir ufs /var/spool/squid 10000 16 256) Demented aint I? I just have too much hard disk space lying around and don’t know what to do with it. I’ve also modified the line http_port 3128 to http_port 127.0.0.1:3128 so that Squid listens only on the localhost … once again not required for this kind of a home setup. You should be able to see a list of the objects in /var/log/squid/store.log . If you can see the sites you’ve been browsing, then it works!
This is basically a beginners quick & dirty guide for personal use. Squid is well capable of of doing a lot of hi-tech advanced stuff as well which are beyond the scope of this post. The performance will get better as the cache fills up. Good luck! If you are looking for an advanced office system with filtering, multi gateway, port forwarding, email, groupware, chat (jabber) anti virus etc, have a look at the ebox platform (previously based on Debian, now on the LTS version of Ubuntu.) They have paid support as well. Also have a look at Clark Connect Community edition and of course their paid version (Runs on Red Hat -or Fedora)
Note:
I’ve had some problems with the Flash uploader in WordPress… probably will have the same problem in Facebook. The Facebook Java thingy however hasn’t been working for quite a while on Linux now due to some compatibility issue on their end. The WordPress issue probably has something to do with IP chains and port forwarding. I’ll post the solution here if I get around to figuring it out… doesn’t bother me much as I prefer the browser uploader on WordPress. I never use the image gallery…its a veritable nighmare!
BTW do make a backup of the squid.conf file before you mess it up. In case its already screwed up, all you need to do is an sudo apt-get purge squid and then do a sudo apt-get install squid again!
Notes:
Sometimes it does not seem to work properly. Usually restarting squid after the connection is made solves the problem. ( sudo /etc/init.d/squid restart )
If you would like to make a comment, please fill out the form below.
Recent Comments