I am using a 3G modem. Unfortunately here it does not work as it should, being unstable and slow, most of time. Only 10% of the full contrated speed is guaranteed. It still is expensive, but for mobility, it is what it is. One other detail: I am always in the same sites. A great number the sites, but usually the same.
A proxy is the best way to make it go faster. According to wikipedia, a proxy is "a server (a computer system or an application program) that acts as a go-between for requests from clients seeking resources from other servers".
Thus, every web access will be requested to the proxy, and it will fetch it in Internet. This web page will remain a little in the system, because if it is requested again, some components will already be downloaded. That means that your browser will show the page faster.
We will see some changes to be made in proxy server, and some others in browser.
We'll be using Squid, a well-known proxy server, famous, free and widely used. This configuration is not difficult, but requires attention. You should know how to use vim.
As usual, installing a sofware in Ubuntu is a breeze. We will work using CLI, instead of GUI. I recommend you to copy the commands written here and paste them in BASH, to avoid typos.
First, let's assure that Ubuntu has informtion about the most recent packages. Open the CLI, and paste the following lines:
sudo aptitude updateRemeber that if you want, you can dispose the whole squid configuration with the following lines:
sudo aptitude install squid
sudo chattr -i /etc/squid/squid.conf.originalYou need vim to be installed. If you are not sure about it, copy this line and paste it on Bash:
sudo rm /etc/squid/squid.conf.original
sudo aptitude purge squid
sudo aptitude install vimSquid Configuration
First of all, let's do a backup copy of it's configuration file:
sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.originalSquid Configuration file has lots of comments. They are really helpful, but can be annoying sometimes. So we will "clean" it all:
sudo chattr +i /etc/squid/squid.conf.original
sudo egrep -v "^$|^ *#" \We must know the version of our software. This is how I can identify squid version:
/etc/squid/squid.conf.original > /etc/squid/squid.conf
sudo dpkg -p squidThis another way to do te same:
Maintainer: Ubuntu Core Developers
Depends: libc6 (>= 2.4), libcomerr2 (>= 1.01), libdb4.7, libkrb53 (>= 1.6.dfsg.2), libldap-2.4-2 (>= 2.4.7), libpam0g (>= 0.99.7.1), netbase, adduser, logrotate (>= 3.5.4-1), squid-common (>= 2.7.STABLE3-4.1ubuntu1), lsb-base (>= 3.2-14), ssl-cert (>= 1.0-11ubuntu1)
Pre-Depends: debconf (>= 1.2.9) | debconf-2.0
Suggests: squidclient, squid-cgi, logcheck-database, resolvconf (>= 0.40), smbclient, winbind
Conflicts: sarg (<<>
sudo dpkg -l | grep squidIn my system, this was the result:
ii squid 2.7.STABLE3-4.1ubuntu1 Internet object cache (WWW proxy cache)Note that if your version is different, may ther be some differences.
Finally, let's start with the changes in Squid:
sudo vim /etc/squid/squid.conf -c ":set number"I did the following changes:
...Line 36 makes my Ubuntu more secure. In line 49 I stated both DNS IPs from my provider. acrescentei a linha 49, com os IPs do DNS do meu provedor. If you don't know about these IPs (they should be given by your ISP), you may see them in your Ubuntu system:
35 icp_access deny all
36 http_port 127.0.0.1:3128
37 hierarchy_stoplist cgi-bin ?
48 extension_methods REPORT MERGE MKACTIVITY CHECKOUT
49 dns_nameservers 184.108.40.206 220.127.116.11
50 hosts_file /etc/hosts
sudo cat /etc/resolv.confIn my system, I had the following:
nameserver 18.104.22.168After these changes, we need to restart squid. So, let's do it:
sudo /etc/init.d/squid reloadTo assure it is working, we can search the open ports. Squid uses port 3128:
sudo netstat -ltnp | grep -i squidIn my system:
tcp 0 0 127.0.0.1:3128 0.0.0.0:* OUÇA 3216/(squid)What is bold in this line, is the same content of line 36 of squid's configuration file.
The changes in our browser will be much easier. Let's do it in Firefox, which is already present in Ubuntu:
Let's first access Preferences, in edit menu.
After, we need to push Advanced button. In network tab, click on CONFIGURE.
Do the same changes I did in this screen. Mine is in Brazilian Portuguese, but the fields are in the same place.
It is done. Proxy server installed and configured, and browser configured to talk to proxy server. In my computer, in about 8 days of use, I had the folowing use of HD:
sudo du -sh /var/spool/squid/You should always control the space used by squid. If it increases too much, you can empty this cache. Type the following:
sudo squid -zDon't forget to answer our poll, saying if this was useful, interesting or unuseful.