Monday, January 24, 2011

Installing Proxy Server In Ubuntu


Intro
Installing an HTTP proxy cache on your computer can bring several advantages:
It allows sharing of the Internet connection.
The cache will display pages faster, even if you do not share your connection.
It allows to optional filtering utility.
Polipo is an efficient and lightweight HTTP proxy cache.

Quick Installation
sudo apt-get install polipo

Then just configure the software (web browser ...etc) to use localhost:8123 as proxy.

Note that polipo is accessible only from your machine , thus reducing security constraints, however there is more room for modifications or any alternative configurations.
Among the options are:
*Setting the memory and disk cache
*Automatic filtering of HTTP headers such as user-agent, http-referer.
URL filter. 
 
Allowing hosts on the LAN to connect
If your LAN is 192.168.0.0/24 and your proxy server 192.168.0.1, edit the following file /etc/polipo/config and add the lines:
proxyAddress = "192.168.0.1"
allowedClients = 127.0.0.1, 192.168.0.0/24

Then type sudo /etc/init.d/polipo restart to take into account the new configuration. 
 
Changing the port
To change the port on which Polipo listen, add the following proxyPort parameter to: /etc/polipo/config
proxyPort = 3128
Remember to sudo /etc/init.d/polipo restart to apply changes 
 
Use a proxy server parent
If you want Polipo sends its own requests to another proxy, add the following parameter:
parentProxy = "squid.example.org: 3128"

Using an alternative DNS server
For enhanced performance, Polipo makes its own DNS resolutions without the use of the operating system.
It uses the DNS registered directly in /etc/resolv.conf.
But you can request that Polipo use other DNS servers (e.g. to use OpenDNS). Simply add the following parameter:
dnsNameServer = 208.67.222.222, 208.67.220.220

Disabling IPv6
If you are not using IPv6, add this parameter:
dnsQueryIPv6 = no

More info
The main problem with polipo is its tendency to retain pages to much and this can cause problems for sites where you'll have to login (Kioskea.net)

1 comment:

  1. Good source of knowledge thanks to this team as it helped melot

    ReplyDelete