Sunday, January 9, 2011

Install Polipo Sebagai Cahce Proxy

Update Paket Kemudian Install :

#apt-get update
#apt-get install polipo

### Basic configuration

# Masukan Alamat Proxy
proxyAddress = 192.168.0.1

# Allow from anyone in the 192.168.0.* range to connect to your proxy
allowedClients = 127.0.0.1, 192.168.0.0/24

fobiddenFile = /etc/polipo/forbidden
proxyOffline = yes
proxyName = polipo.redebian-smoker
disableLocalInterface = false

===========================================================
keterangannya :
fobiddenFile = /etc/polipo/forbidden
==> menunjukkan tempat direktori file forbidden

proxyOffline
==> dengan menggunakan metoda proxyOffline ini, dapat digunakan untuk melakukan browsing ke situs-situs yang pernah dikunjungi pada saat online. Anda dapat melakukan browsing kembali ke situs-situs tersebut pada saat anda offline.Tentunya situs-situs ini pernah anda kunjungi sebelumnya.

proxyName
==> nama dari polipo proxy

disableLocalInterface
==> dengan mengeset nilainya menjadi false anda dapat melakukan konfigurasi polipo ini dari localhost. caranya dari browser http://localhost:8123
=========================================================

sudo vi /etc/apt/apt.conf

Masukan perintah berikut

Acquire::http::Proxy "http://192.168.0.1:8123";

======================================================
iptables untuk polipo transparent jadi ga usah setting proxy di client

iptables -t nat -I PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8128
======================================================
untuk merubah port
proxyPort = 3128
jangan lupa restart
sudo /etc/init.d/polipo restart
======================================================
 
cara block situs 
Edit file /etc/polipo/forbiden

kemudian masukan situs web yang akan di blok contoh : 
detik.com

keluar save, jangan lupa restart...
http://en.kioskea.net/faq/804-ubuntu-installing-an-http-proxy-server-squid
http://en.kioskea.net/faq/805-installing-an-easy-http-proxy-cache-polipo
http://forum.devilzc0de.org/thread-772.html
http://talk.maemo.org/showthread.php?t=48544
 ============================================================
http://forum.linux.or.id/viewtopic.php?f=16&t=12900&start=60
http://poerwo2211.wordpress.com/2008/01/22/polipo-proxy-gesit-dan-lincah/

Lagi suka utak-atik polipo proxy nih, pake squid berat
polipo config ==========================================================
# Sample configuration file for Polipo. -*-sh-*-
# You should not need to use a configuration file; all configuration
# variables have reasonable defaults. If you want to use one, you
# can copy this to /etc/polipo/config or to ~/.polipo and modify.
# This file only contains some of the configuration variables; see the
# list given by “polipo -v” and the manual for more.
 -------------------------------------------------------------------
### Configuration from Mandriva RPM
### ********************************
-----------------------------------------------------------------
# Jika ingin dijalankan sebagai daemon, set ke true
daemonise = true
------------------------------------------------------------------------
# Permision untuk file di cache dan direktori cache
diskCacheFilePermissions = 0600
diskCacheDirectoryPermissions = 0700
disableLocalInterface = true
forbiddenUrl = http://localhost:8123/1×1.gif
---------------------------------------------------------------
# Masukkan alamat situs yang dilarang dibuka ke dalam file forbidden, seperti alamat banner iklan, dst
forbiddenFile = /etc/polipo/forbidden
------------------------------------------------------------------
# Masukkan alamat situs yang tidak ingin di cache ke dalam file uncachable.
uncachableFile = /etc/polipo/uncachable
 ------------------------------------------------------------------
## Uncomment this if you have no network:
## Un-comment untuk menjalankan mode Offline.
## Dengan mode Offline, maka anda bisa membuka halaman web yang sudah ter cache.
# proxyOffline = yes
 --------------------------------------------------------------------
## Uncomment these to use polipo with TOR
## Uncomment dan seting dibawah ini jika memakai Parent Proxy dengan TOR
## **************************************
# socksParentProxy=localhost:9050
# disableVia = true
 --------------------------------------------------------------
### Basic configuration
### *******************
# Uncomment one of these if you want to allow remote clients to
# connect:
# Uncomment (Anda hilangkan tanda pagar) dan set IP untuk Polipo, agar Komputer Client lain
# Bisa konek dan memakai Polipo di komputer ini sebagai Proxy:
# proxyAddress = “::0″ # both IPv4 and IPv6 # Alamat IP dengan IPV$ dan IPV6
proxyAddress = “192.168.0.1″ # IPv4 only # Hanya alamat IP dalam IPV4
-----------------------------------------------------------------------------------
# If you do that, you’ll want to restrict the set of hosts allowed to
# connect:
# JIka anda lakukan hal diatas, maka anda ingin membatasi User yang Boleh
# melakukan koneksi.
# allowedClients = “134.157.168.57″
# allowedClients = “134.157.168.0/24″
--------------------------------------------------------------------------------
# Uncomment this if you want your Polipo to identify itself by
# something else than the host name:
# Uncomment dan beri nama polipo proxy server dengan nama lain.
# default nya memakai host name:
proxyName = “cipung.biroe.net”
------------------------------------------------------------------
# Uncomment this if you want to use a parent proxy:
# Uncomment dibawah ini jika ingin menggunakan Parent Proxy:
# parentProxy = “squid.example.org:3128″
-------------------------------------------------------------------------------
# Uncomment this if you want to use a parent SOCKS proxy:
# Uncomment dan seting dibawah ini jika memakai Parent Proxy SOCKS
# socksParentProxy = “localhost:9050″
# socksProxyType = socks5
-------------------------------------------------------------------------------------------
# Uncoment this if the parent proxy requires authorisation:
# Uncomment dibawah ini dan setting ke user dan password buat Proxy Parrent:
# parentAuthCredentials = “user:password”
------------------------------------------------------------------------------------------
### Memory
### ******
# Uncomment this if you want Polipo to use a ridiculously small amount
# of memory (a hundred C-64 worth or so):
# Uncoment dibawah ini jika punya memori RAM sedikit
# ( Bahkan Komputer Commodore C-64 bisa dipakai sebagai Polipo Proxy)
# chunkHighMark = 819200
# objectHighMark = 128
------------------------------------------------------------------------------------------
# Uncomment this if you’ve got plenty of memory:
# Uncomment ini jika punya banyak memori :
chunkHighMark = 50331648
objectHighMark = 16384
-------------------------------------------------------------------------------------------
### On-disk data
### ************
# Uncomment this if you want to disable the on-disk cache:
# Un comment dibawah ini jika tidak ingin memakai on-disk cache
# (memakai partisi NFS yang sudah dimount):
# diskCacheRoot = “”
--------------------------------------------------------------------------------------
# Uncomment this if you want to put the on-disk cache in a -
# non-standard location :
# Uncoment dibawah ini jika ingin meletakkan on-disk cache -
# ke lokasi lain ( deafultnya di /var/cache/polipo ) :
# diskCacheRoot = “~/.polipo-cache/”
------------------------------------------------------------------------------------
# Uncomment this if you want to disable the local web server:
# Uncomment dibawah ini jika ingin WebServer lokal Polipo di disable:
localDocumentRoot = “”
--------------------------------------------------------------------------------------
# Uncomment this if you want to enable the pages under /polipo/index?
# and /polipo/servers?. This is a serious privacy leak if your proxy
# is shared.
# disableIndexing = false
# disableServersList = false
----------------------------------------------------------------------------------------
### Domain Name System
### ******************
# Uncomment this if you want to contact IPv4 hosts only (and make DNS
# queries somewhat faster):
# Uncomment dibawah ini jika ingin meng koneksi ke jaringan IPV4 saja
# ( dan membuat Query DNS menjadi lebih cepat)
dnsQueryIPv6 = no
-----------------------------------------------------------------------------------------
# Uncomment this if you want Polipo to prefer IPv4 to IPv6 for
# double-stack hosts:
# dnsQueryIPv6 = reluctantly
-------------------------------------------------------------------------------------
# Uncomment this to disable Polipo’s DNS resolver and use the system’s
# default resolver instead. If you do that, Polipo will freeze during
# every DNS query:
-----------------------------------------------------------------------------------
# Uncommnet dibawah ini jika ingin memakai DNS resolver system default,
# dan mematikan Polipo DNS resolver, tapi jika anda lakukan ini, Polipo
# akan “freeze” setiap kalau melakukan query DNS:
# dnsUseGethostbyname = yes
dnsUseGethostbyname = reluctantly
-------------------------------------------------------------------------------------
### HTTP
### ****
# Uncomment this if you want to slightly reduce the amount of
# information that you leak about yourself:
censoredHeaders = From, Accept-Language
----------------------------------------------------------------------------------
#censoredHeaders = set-cookie, cookie, cookie2, from, accept-language, x-pad
censorReferer = maybe
---------------------------------------------------------------------------------------
# Uncomment this if you want to use Poor Man’s Multiplexing; increase
# the sizes if you’re on a fast line. They should each amount to a few
# seconds’ worth of transfer; if pmmSize is small, you’ll want
# pmmFirstSize to be larger.
# Note that PMM is somewhat unreliable.
pmmFirstSize = 16384
pmmSize = 8192
---------------------------------------------------------------------------------------
# Uncomment this if your user-agent does something reasonable with
# Warning headers (most don’t):
relaxTransparency = maybe
--------------------------------------------------------------------------------------
# Uncomment this if you never want to revalidate instances for which
# data is available (this is not a good idea):
#relaxTransparency = yes
-----------------------------------------------------------------------------------
# Uncomment this if you want to avoid revalidating instances with a
# Vary header (this violates RFC 2616):
# mindlesslyCacheVary = true
----------------------------------------------------------------------------------------
# Uncomment this if your Polipo is shared, and you like the warm
# feeling that comes from respecting the specs:
# Jika ingin Cache dari Polipo di Share untuk komputer lain, anda set ke “true”
# Jika hanya anda pakai sendiri, anda set ke “false”.
# Jika di Share, maka setting juga range IP dan IP buat Polipo Proxy nya.
cacheIsShared = true
-------------------------------------------------------------------------------------------
# Jika ingin Halaman web yang redirect tidak di Cache, set ke “true”
# Jika ingin Halaman web yang redirect di Cache, set ke “false”
dontCacheRedirects = false
-------------------------------------------------------------------------------------------
## Transparant Proxy
## *****************
# Uncoment this if you want Polipo behave as a transparent proxy
# Hilangkan Tanda pagar dibawah ini, jika kamu ingin Polipo menjadi Transparant Proxy
maxAge = 0
maxExpiresAge = 0
allowedPorts = 1-65535
tunnelAllowedPorts = 1-65535
diskCacheTruncateTime = 10
diskCacheUnlinkTime = 60
diskCacheTruncateSize = 4 MB

======================================================================
forbidden buat block iklan
===================================================
# Sample forbidden URLs file for polipo. -*-sh-*-
# Put this in /etc/polipo/forbidden or in ~/.polipo-forbidden.
# Forbid all hosts belonging to a given domain name:
/banners/
/banner/
doubleclick.net
ads.osdn.com
ads.osdn.net
ads.freshmeat.net
ads.netpool.net
flycast.com
ads-webad.sol.no .gif
www.linuxlinks.com/gif/ .gif
imgis.com
adforce.com
ads.admonitor.net
focalink.com
image.linkexchange.com
valueclick.com
bannerspace.com
dezines.com/banners
206.41.20.7 .gif
ads.web.aol.com
ad.preferences.com
209.207.224.220
ads.link4ads.com
sandpiper.net
webreference.com/ads
ads. msn.com/ads
wired.com/advertising
209.249.169.51
mediaplex.com
adclix.com
commonwealth
linuxkonsult.m.se
3rex.net
ads.x10.com
cmpnet.com/ads
hyperbanner.net
bustnet.com/cgi-bin/ads
www.eads.com/adserve
adserver.buttonware.net
adcenter.net
aftonbladet.se/annons
adcontroller.unicast.com
ads.zdnet.com
ads.fool.com
adserver
cgi-acc/clickthru
deja.com/ads
webconnect.net
.deja.com/ads/
www.heise.de/realmedia/ads/
adserv.spiegel.de/images/
media.fastclick.net
tribalfusion.com
gavzad
burstnet
googlesyndication.com
googlesyndication.com/
==================================================

http://bodhizazen.net/Tutorials/TOR#Browser

Using iptables

If you are an iptables wizard, you can add a few "simple" rules to iptables to redirect outbound traffic to TOR.
For Example:
sudo iptables -t nat -A OUTPUT -m owner --uid-owner root -j ACCEPT
sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -m ! --uid-owner tor -j REDIRECT --to-port 8123

1 comment:

  1. If you're looking for a good contextual advertising network, I suggest you take a peek at ExoClick.

    ReplyDelete