POLIPO Sebagai Server Proxy Dengan TOR SOCKS Di FreeBSD
· 2 min read · Label UnixBSD
Polipo merupakan web proxy server caching dan forwarding yang ringan. Polipo memiliki berbagai kegunaan, mulai dari membantu keamanan dengan melakukan filtering traffic; melakukan web browser caching dan penelusuran jaringan komputer lainnya. Polipo merupakan web proxy single-threaded, yang memiliki kemampuan web caching yang sangat tinggi. Polipo dirancang untuk sekelompok orang yang berbagi sumber daya internet, untuk mempercepat server web dengan melakukan caching permintaan berulang.
Server proxy yang menggunakan polipo pada sistem operasi FreeBSD dapat berfungsi untuk memblokir situs yang dianggap tidak pantas untuk diakses. Dengan menyimpan cache pada disk, server proxy Polipo cepat, ringan, dan kecil, sangat berguna untuk jaringan yang tidak memiliki server proxy besar.
Untuk menginstal Polipo di FreeBSD, Anda memerlukan server FreeBSD yang menyediakan repositori Polipo. Dalam tutorial ini, spesifikasi sistem yang digunakan adalah:
CPU: AMD Phenom II X4 965 3400 MHz
Memory: 2 gb
Hard Disk: 40 gb
IP LAN: 192.168.9.3/24
IP TOR: 192.168.9.3
Port TOR: 9050
IP Polipo: 192.168.9.3
Hostname: router2
Domain: unixexplore.com
Port Polipo: 8118
Jika Anda menggunakan paket pkg, Anda dapat menginstal polipo dengan mengetik skrip di bawah ini.
Pada folder /etc/newsyslog.conf masukkan skrip berikut.
Setelah itu, buat izin kepemilikan untuk berkas konfigurasi.
Dengan mengikuti tutorial ini Anda akan meningkatkan sistem keamanan komputer Anda, terutama keamanan pada port 80.
Server proxy yang menggunakan polipo pada sistem operasi FreeBSD dapat berfungsi untuk memblokir situs yang dianggap tidak pantas untuk diakses. Dengan menyimpan cache pada disk, server proxy Polipo cepat, ringan, dan kecil, sangat berguna untuk jaringan yang tidak memiliki server proxy besar.
![]() |
Diagram Polipo sebagai Proxy Srver |
Untuk menginstal Polipo di FreeBSD, Anda memerlukan server FreeBSD yang menyediakan repositori Polipo. Dalam tutorial ini, spesifikasi sistem yang digunakan adalah:
Spesifikasi System
OS: FreeBSD 13.2-STABLECPU: AMD Phenom II X4 965 3400 MHz
Memory: 2 gb
Hard Disk: 40 gb
IP LAN: 192.168.9.3/24
IP TOR: 192.168.9.3
Port TOR: 9050
IP Polipo: 192.168.9.3
Hostname: router2
Domain: unixexplore.com
Port Polipo: 8118
Install Polipo
Pada tutorial kali ini kita akan menjadikan Polipo sebagai proxy gateway untuk Tor, artinya kita menjadikan TOR sebagai backend sedangkan Polipo sebagai frontend. Jadi setiap klien yang mengakses web browser akan dilayani oleh Polipo.Untuk menginstal TOR, Anda dapat membaca artikel sebelumnya yang membahas proses instalasi TOR di FreeBSD. Langsung saja kita ke pembahasannya, yaitu menginstal dan mengonfigurasi aplikasi Polipo.
Langkah pertama yang harus dilakukan adalah menginstal aplikasi Polipo melalui port atau pkg pada server FreeBSD.
Install Polipo
root@router2:~ # cd /usr/ports/www/polipo
root@router2:~ # make install clean
Update PKG
root@router2:~ # pkg update -f
root@router2:~ # pkg upgrade -f
Skrip di atas digunakan untuk memperbarui dan meng-upgrade paket pkg. Setelah proses pembaruan selesai, lanjutkan dengan instalasi Polipo.
Install Polipo dengan PKG
root@router2:~ # pkg install polipo
Tunggu beberapa menit hingga proses instalasi Polipo selesai. Kemudian kita lanjutkan dengan mengaktifkan Polipo di file rc.conf, serta grup polipo dan pengguna polipo. Aktifkan Polipo di file rc.conf, agar Polipo dapat berjalan secara otomatis saat server direstart/booting atau saat server dimatikan.
Aktifkan Polipo di file /etc/rc.conf
root@router2:~ # ee /etc/rc.conf
polipo_enable="YES"
Setelah kita selesai menjalankan rc.d, langkah selanjutnya adalah membuat berkas log Polipo. Gunakan skrip di bawah ini untuk membuat berkas log Polipo.
Buat file log untuk Polipo
root@router2:~ # touch /var/log/polipo
Pada folder /etc/newsyslog.conf masukkan skrip berikut.
Edit file /etc/newsyslog.conf
root@router2:~ # ee /etc/newsyslog.conf
/var/log/polipo polipo: 640 3 100 * J /var/run/polipo/polipo.pid 30
Jalankan perintah chown
root@router2:~ # chown -R polipo:polipo /usr/local/etc/polipo
root@router2:~ # chown -R polipo:polipo /usr/local/etc/polipo/
root@router2:~ # chown -R polipo:polipo /var/log/polipo
Jalankan perintah chmod
root@router2:~ # cd /usr/local/etc/polipo
root@router2:~ # chmod +w config
Konfigurasi selanjutnya adalah mengedit berkas konfigurasi yang ada di folder /usr/local/etc/polipo. Bisa dilakukan dengan putty atau winscp. Mengedit berkas konfigurasi lebih mudah dilakukan dari jarak jauh melalui aplikasi winscp.Edit file config Polipo
root@router2:/usr/local/etc/polipo # cd /usr/local/etc/polipo
root@router2:~ # ee config
Edit file "config" sesuai kebutuhan. Untuk mengaktifkan baris skrip, hapus tanda "#", jika ada tanda "#" di awal baris skrip, berarti skrip tersebut tidak aktif.
Yang harus Anda aktifkan dalam berkas konfigurasi adalah:
Yang harus Anda aktifkan dalam berkas konfigurasi adalah:
Ubah sckrip file config Polipo
proxyAddress = "192.168.9.3"
allowedClients = 192.168.9.0/24, 127.0.0.1
proxyName = "router2.unixexplore.com"
socksParentProxy = "192.168.9.3:9050"
socksProxyType = socks5
cacheIsShared = false
diskCacheRoot = ""
Setelah itu anda restart Polipo.
Restart Polipo
root@router2:~ # service polipo restart
Stopping polipo.
Starting polipo.
root@router2:~ #
Saat mengedit file konfigurasi, yang perlu diperhatikan adalah skrip socksParentProxy dan socksProxyType. IP 127.0.01 dan Port 9050 adalah IP dan Port file torrc yang ada di /usr/local/etc/tor program TOR. Ini berarti Polipo diteruskan ke IP dan port TOR. Sementara itu, socksProxyType = socks5 adalah soket dari file torrc milik program TOR. Ini berarti soket Polipo diteruskan ke soket TOR, sehingga program TOR menjadi backend program Polipo.
Sekarang kita uji pada peramban web, misalnya Google Chrome. Pada menu pengaturan, pilih pengaturan jaringan. Lihat gambar di bawah ini.
![]() |
Penaturan IP Proxy di Windows |
Mari kita lihat apakah port 8118 Polipo terbuka.
Periksa apakah port Polipo (8118) telah terbuka
root@router2:~ # sockstat -4 | grep polipo
polipo polipo 651 4 tcp4 192.168.9.3:8118 *:*
root@router2:~ #
Pada perintah di atas terlihat jelas bahwa port 8118 telah terbuka pada IP 192.168.9.3. Ini berarti bahwa program Polipo sedang berjalan. Berikut adalah SKRIP LENGKAP dari berkas konfigurasi dari program Polipo.
Script lengkap Polipo
# 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.
### Basic configuration
### *******************
# Uncomment one of these if you want to allow remote clients to
# connect:
# proxyAddress = "::0" # both IPv4 and IPv6
proxyAddress = "192.168.9.3" # IPv4 only
proxyPort = 8118
# If you do that, you'll want to restrict the set of hosts allowed to
# connect:
# allowedClients = 127.0.0.1, 134.157.168.57
allowedClients = 192.168.9.0/24, 127.0.0.1
# Uncomment this if you want your Polipo to identify itself by
# something else than the host name:
proxyName = "router2.unixexplore.com"
# Uncomment this if there's only one user using this instance of Polipo:
cacheIsShared = false
# Uncomment this if you want to use a parent proxy:
# parentProxy = "squid.example.org:3128"
# Uncomment this if you want to use a parent SOCKS proxy:
socksParentProxy = "192.168.9.3:9050"
socksProxyType = socks5
# Uncomment this if you want to scrub private information from the log:
# scrubLogs = true
### Memory
### ******
# Uncomment this if you want Polipo to use a ridiculously small amount
# of memory (a hundred C-64 worth or so):
chunkHighMark = 819200
objectHighMark = 128
# Uncomment this if you've got plenty of memory:
# chunkHighMark = 50331648
# objectHighMark = 16384
# Access rights for new cache files.
diskCacheFilePermissions=0640
# Access rights for new directories.
diskCacheDirectoryPermissions=0750
### On-disk data
### ************
# Uncomment this if you want to disable the on-disk cache:
diskCacheRoot = ""
# Uncomment this if you want to put the on-disk cache in a
# non-standard location:
# diskCacheRoot = "~/.polipo-cache/"
# Uncomment this if you want to disable the local web server:
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):
# 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:
# dnsUseGethostbyname = yes
### HTTP
### ****
# Uncomment this if you want to enable detection of proxy loops.
# This will cause your hostname (or whatever you put into proxyName
# above) to be included in every request:
# disableVia=false
# Uncomment this if you want to slightly reduce the amount of
# information that you leak about yourself:
# censoredHeaders = from, accept-language
censorReferer = maybe
# Uncomment this if you're paranoid. This will break a lot of sites,
# though:
# censoredHeaders = set-cookie, cookie, cookie2, from, accept-language
# censorReferer = true
# 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 have no network:
# proxyOffline = yes
# Uncomment this if you want to avoid revalidating instances with a
# Vary header (this is not a good idea):
# mindlesslyCacheVary = true
# Uncomment this if you want to add a no-transform directive to all
# outgoing requests.
# alwaysAddNoTransform = true
Silahkan Berkomentar, Kakak...! Bunda...!
Posting Komentar