IKLAN

Pelatihan
&
Jasa Setting Proxy High Perfomance

Di Jamin Youtube tercache & Game online terupdate cepat
  • Pelatihan & Setting On the site
Mobile Phone:085868788968
Pin BB:52595EA2
BUTUH MOBIL BARU/BEKAS?

DP minimal 30 % dari harga mobil baru atau bekas. Syarat untuk karyawan/pns: Fotokopi KTP pemohon, Kartu Keluarga, Rincian Gaji, Rekening Listrik, Surat/Akta nikah, Telepon, PDAM, PBB, Rekening Tabungan & NPWP
Syarat untuk wiraswata:Plus SIUP/TDP, Laporan keuangan terakhir
Contact Person : Eka (082227594993)
Pin BB : 52595EA2

Jasa Pembuatan RT RW Net dan Warnet

Modal Hanya 5 JT-an..!!!

Meliputi:

=>Radio Access Point TP-LINK

=>Antena OMNI

=>Pigtail

=>Kabel UTP 25 meter

=>CPU P3 Mikrotik 2nd, CPU Dual COre Proxy Server 2nd dan Tower 3 Pipa Galvanis

Keuntungan

=>Lebih Murah dalam 1 paket komplit

=>RT/RW-Net Siap Pakai

=>PJK akan membantu promosi

Call/SMS = 085868788968
Pin BB :52595EA2


SEWA MOBIL PEKALONGAN DAN BATANG
Sewa/Carter Mobil Dalam Kota / Luar Kota (Se-Jawa) + Sopir.
Hubungi: Eka HP: 085868788968 / 082227594993
Pin BB : 52595EA2
Alamat:
Jl. Akasia Raya No.5 Perumahan Kalisalak Batang
Jl. Trapesium 3 No.15 Perumahan Limas Indah Pekalongan


SPACE INI DI SEWAKAN UNTUK IKLAN

Hubungi :

Mobile Phone:085868788968
Pin BB:52595EA2




Popular Posts

Mengkonfigurasi squid (proxy web cache) sebagai transparan proxy

Squid yang mirip dengan si Cumi-cumi ini yang bertugas untuk membantu web cache tidak lari ke internet namun pada cache squid sendiri dan fungsi-fungsi lain yang sangat bermanfaat lainya tentunya. Kali ini sedikit tulisan dari sebagaian data di hardisk dari pada hilang kemakan virus, mending tak tulis di blog. Sebelumnya terima kasih kepada suhu jaringan alias Mr Yo yang telah memberikan ilmunya yang sungguh bermanfaat dan sebagai team work yang semangat. Sungguh saya tak akan dapat ilmu seperti ini dalam bangku kuliah maupun dalam buku-buku tentang Jaringan komputer.

Langsung aja tak usah kebanyakan cincong. Kali ini distro yang di gunakan adalah Linux Slackware 12 (0,1,2,) terserah semua bisa berjalan dengan normal di kernel 2.6

Langkah-langkah pertamanya adalah install Slackware pada PC yang akan di jadikan router/ server, perhatian untuk instalasinya cukup Linux Base dan binary C++,gcc, dan yang lain yang berbasis X Window sebaiknya jangan ikut di install. Oke bro. Klu tak terjadi masalah instalasinya cukup memakan waktu kurang dari 10 menit.

Yang perlu diperhatikan adalah pembuatan partisi /cahe harus berada di tengah posisi sector hardisk . Dengan ukuran tak lebih dari 20GB, “kecil-kecil tapi banyak” katanya Mr.Yo. ehe. Dengan RAM yang besar maka akan lebih baik. Klu saya bilang lebih dari 512MB,ato 1 GB, 2 GB RAM akan bagus, dan Prosesor pentium II tak masalah. kakaka

Siapkan Squid versi terbaru yang bisa di didownlaod disini , namun penulis menggunkaan versi Squid Cache: Version 2.7.STABLE . Untuk tahap penginstalanya kita login dahulu seabagi root dalam linux yang baru kita install tadi.

1. tar zxvf squid-2.7.STABLE6.tar.gz -C /usr/local/src

2. ./configure --prefix=/usr/squid --bindir=/usr/bin --sbindir=/usr/sbin --enable-gnuregex --enable-dlmalloc --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --with-aio --with-dl --enable-storeio=ufs,aufs --enable-removal-policies=lru,heap --disable-ident-lookups --enable-underscores --enable-delay-pools --enable-kill-parent-hack --disable-wccp --disable-wccpv2 --enable-snmp --enable-cachemgr-hostname="maingate.informatika.net" --enable-cache-digests --enable-linux-netfilter --enable-ssl --with-openssl --enable-htcp --disable-poll --disable-epoll --disable-http-violations --disable-internal-dns --with-maxfd=8192 --enable-icmp --disable-hostname-checks --enable-unlinkd

Tanda ” dalam hotsname bisa diubah sesuai kebutuhan. oke bro

3. make ; make install

4. Instalasi squid telah OKE, langkah selanjutnya tinggal konfigurasi squid kita bro, caranya edit squid.conf pada directory /usr/squid/etc/

5. Langkah yang tidak ketinggalan adalah buat user dan group squid groupadd squid

6. Untuk direktory yang berkaitan dengan squid sebaiknya di chown squid * hal ini supaya squid dapat secara bebas mengakses direktori / partisi misalnya /cache1 ,/cache2, /var log, dan lain-lain contohnya ;

root@router:/usr/squid# ls -l
total 0
drwxr-xr-x 4 squid squid 96 2009-03-05 15:39 adzap/ # untuk blokc banner, iklan, dll , sesuaikan dengan fungsinya
drwxr-xr-x 2 squid squid 296 2009-03-05 21:01 etc/
drwxr-xr-x 2 squid squid 192 2009-03-05 21:01 libexec/
drwxr-xr-x 5 squid squid 144 2009-03-05 21:01 share/
drwxr-xr-x 3 squid squid 72 2009-03-05 13:53 var/

7. Banyak blog maupun forum-forum yang membahas tentang squid ini, namun sebagai contoh dari konfigurasi yang ada pada Lab Informatika UAD yang digunakan adalah sebagai berikut ;

#####################################################
#squid.conf
######################################################
http_port 8080
icp_port 3130
hierarchy_stoplist cgi-bin ?
######################################################
acl QUERY urlpath_regex cgi-bin ?
######################################################
#dead_peer_timeout 5 seconds
no_cache deny QUERY
cache_mem 6 MB
cache_swap_low 95
cache_swap_high 98
maximum_object_size 64 MB
maximum_object_size_in_memory 32 KB
ipcache_size 512
ipcache_low 95
ipcache_high 98
fqdncache_size 512
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

cache_dir aufs /cache1 10240 24 256
cache_dir aufs /cache2 10240 24 256

cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log none
emulate_httpd_log off
log_ip_on_direct on
mime_table /usr/squid/etc/mime.conf
log_mime_hdrs off
pid_filename /var/log/squid.pid
debug_options ALL,1
log_fqdn off
ftp_user squid@root.net
ftp_list_width 32
ftp_passive on
ftp_sanitycheck off
#cache_dns_program /usr/squid/libexec/dnsserver
#dns_children 24
#dns_defnames on
unlinkd_program /usr/squid/libexec/unlinkd
redirect_program /usr/squid/adzap/scripts/squid_redirect
#redirect_program /usr/squid/banner/redirector.pl
redirect_children 24
redirect_rewrites_host_header on
digest_generation on
request_body_max_size 0 KB
######################################################
refresh_pattern -i .gif$ 1440 500% 262800
refresh_pattern -i .jpg$ 1440 700% 262800
refresh_pattern -i .htm$ 20 40% 40320
refresh_pattern -i .html$ 20 40% 40320
refresh_pattern /$ 15 25% 20160
refresh_pattern -i .exe$ 2880 1000% 262800
refresh_pattern -i .zip$ 2880 1000% 262800
refresh_pattern -i .mpg$ 2880 1000% 262800
refresh_pattern -i .mov$ 2880 1000% 262800
refresh_pattern -i .pdf$ 2880 1000% 262800
refresh_pattern -i .avi$ 2880 1000% 262800
refresh_pattern -i .swf$ 2880 1000% 262800
refresh_pattern ^ftp: 10080 95% 241920
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|?) 0 0% 0
refresh_pattern . 1440 95% 4320
######################################################
quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 100
range_offset_limit 0 KB
connect_timeout 5 seconds
peer_connect_timeout 5 seconds
read_timeout 40 seconds
request_timeout 20 seconds
half_closed_clients off
shutdown_lifetime 20 seconds
#####################################################
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl localnet src 192.168.34.0/255.255.255.0 # sesuaikan dengan ip addres
acl game dstdomain .rf-online.web.id # block akses alamat situs web
######################################################
http_access deny game
######################################################
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 20 # time
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 119
acl Safe_ports port 1025-6999 # unregistered ports
acl Safe_ports port 7001-65505
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemake
acl Safe_ports port 777 # multiling http
acl deny_ports port 7000
acl CONNECT method CONNECT
acl all src 0.0.0.0/0
acl VIRUS urlpath_regex winnt/system32/cmd.exe?
######################################################
acl snmppublic snmp_community public
snmp_port 3401
snmp_access allow snmppublic all
######################################################
http_access allow localnet
http_access allow localhost
http_access deny all
icp_access allow localnet
icp_access allow localhost
http_access deny manager

#Deny requests to unknown ports
http_access deny !Safe_ports
http_access deny CONNECT deny_ports
#Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access deny VIRUS
icp_access deny all
#miss_access allow all

http_accessallow manager localhost
http_access deny manager localnet
cache_mgr root@informatika.net
cachemgr_passwd baikhati all

cache_effective_user squid
cache_effective_group squid
forwarded_for off

icp_query_timeout 100
maximum_icp_query_timeout 150
logfile_rotate 2
memory_pools off
pipeline_prefetch on
log_icp_queries off
icp_hit_stale on
vary_ignore_expire on
store_avg_object_size 13 KB
store_objects_per_bucket 10
client_db off
query_icmp off
test_reachability off
icon_directory /usr/squid/share/icons
error_directory /usr/squid/share/errors
redirector_bypass on
ignore_unknown_nameservers on
#store_dir_select_algorithm round-robin
#store_dir_select_algorithm least-load
visible_hostname proxy.informatika.net
ie_refresh on

8. Simpan konfigurasi swap dengan perintah squid -z dan jalankan squid dengan squid -D

9. Agar PC kita bertugas sebagai router secara otomatis saat koputer dihidupkan makan dalam rc.local Iperlu ditambahkan script sebagai berikut

squid -D
iptables -F
route add default gw 172.10.69.1
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A POSTROUTING -s 192.168.34.0/24 -d 0/0 -j MASQUERADE

10. Apa bila terjadi masalah , lihatlah apakah konfigurasi yang telah kita bahas panjang lebar diatas sudah benar, bila masih terjadi error lihatlah sumber errornya.

root@router:/etc# tail -f /var/log/squid/cache.log

2009/03/23 09:35:32| logfileOpen: opening log /usr/squid/var/logs/netdb.state
2009/03/23 09:35:32| logfileClose: closing log /usr/squid/var/logs/netdb.state
2009/03/23 09:35:32| NETDB state saved; 0 entries, 0 msec
2009/03/23 10:44:36| logfileOpen: opening log /usr/squid/var/logs/netdb.state
2009/03/23 10:44:36| logfileClose: closing log /usr/squid/var/logs/netdb.state
2009/03/23 10:44:36| NETDB state saved; 0 entries, 0 msec
2009/03/23 11:35:37| httpReadReply: Excess data from “GET http://www.cbox.ws/box/jsv4_1.php?r=10″
2009/03/23 11:40:22| logfileOpen: opening log /usr/squid/var/logs/netdb.state
2009/03/23 11:40:22| logfileClose: closing log /usr/squid/var/logs/netdb.state
2009/03/23 11:40:22| NETDB state saved; 0 entries, 0 msec

11. Bila semua telah sukses, saya ucapkan selamat atas usaha anda dalam membuat transparant proxy.

12. Saatnya kita mengamati proxy kita yang telah dibuat, lihat lah user2 nakal pada jaringan kita.

root@router:/etc# tail -f /var/log/squid/access.log

1237612978.472 851 192.168.34.1 TCP_MISS/200 1858 GET http://1.gravatar.com/avatar/3b3d575ccfb04aa8c57ee26a8b6fe390? – DIRECT/72.233.69.5 image/png1237612978.485 2491 192.168.34.1 TCP_MISS/200 1701 GET http://0.gravatar.com/avatar/c29f3761b52d3551896b4a9b7efbcdf0? – DIRECT/72.233.69.5 image/png1237612978.924 530 192.168.34.4 TCP_MISS/206 7373 GET http://au.download.windowsupdate.com/msdownload/update/software/secu/2009/02/windowsxp-kb958690-x86-express-enu_553a8162ad6174f656a0f581e6da0f638fa477c5.cab – DIRECT/65.54.82.170 application/octet-stream

Bila suatu saat terjadi masalah dengan router dan squid yang sudah dibuat, maka sekali lagi lihatlah sumber erornya.

Pengembangan selanjutnya sangat diperlukan, karena tidak cukup sampai disini saja. Kurang lebihnya mohon maaf, kesempurnaan selanjutnya mohon masukanya.

Konfigurasi Squid

Konfigurasi Squid
< Catatan: - Penginstalan dengan metode ini telah berhasil dilakukan pada sistem RH6.2, RH7.0, RH7.1, dan RH7.2 - Squid yang telah digunakan adalah squid-2.4.STABLE1-src.tar.gz dan squid-2.4.STABLE4-src.tar.gz, squid-2.4.STABLE6-src.tar.gz o>Persiapan:
Downloadlah file-file yang dibutuhkan untuk instalasi dan optimasi squid pada direktori yg anda suka (misal /var/tmp):
- squid-2.4.STABLE6-src.tar.gz (bisa didapat di www.squid-cache.org)
- malloc.tar.gz (bisa didapat di http://debian.web.id/download/lib/malloc.tar.gz)
- floppy.tgz (bisa didapat di http://debian.web.id/download/systool/floppy.tgz)
o> Langkah-langkah instalasi:
Konfigurasi dan Optimasi Squid
——————————-
- ekstraklah file squid hasil d/l an
# tar zxvf squid-2.4.STABLE6-src.tar.gz
- squid proxy server tidak dapat berjalan sebagai super user root, oleh karena itu, buatlah user yang akan menjalankan squid:
# useradd -d /cache/ -r -s /dev/null squid >/dev/null 2>&1
# mkdir /cache/ —- anda tidak perlu mengetikkan perintah ini jika anda
telah membuat partisi /cache pada saat penginstalan linux pertama kali.
# chown -R squid.squid /cache/
- editlah file icons/Makefile.in dengan text editor yang anda suka dan gantilah baris:
DEFAULT_ICON_DIR = $(sysconfdir)/icons
menjadi:
DEFAULT_ICON_DIR= $(libexecdir)/icons
- editlah file src/Makefile.in dengan text editor yang anda suka dan gantilah baris:
DEFAULT_CACHE_LOG = $(localstatedir)/logs/cache.log
menjadi:
DEFAULT_CACHE_LOG = $(localstatedir)/log/squid/cache.log
DEFAULT_ACCESS_LOG = $(localstatedir)/logs/access.log
menjadi:
DEFAULT_ACCESS_LOG = $(localstatedir)/log/squid/access.log
DEFAULT_STORE_LOG = $(localstatedir)/logs/store.log
menjadi:
DEFAULT_STORE_LOG = $(localstatedir)/log/squid/store.log
DEFAULT_PID_FILE = $(localstatedir)/logs/squid.pid
menjadi:
DEFAULT_PID_FILE = $(localstatedir)/run/squid.pid
DEFAULT_SWAP_DIR = $(localstatedir)/cache
menjadi:
DEFAULT_SWAP_DIR = /cache
DEFAULT_ICON_DIR = $(sysconfdir)/icons
menjadi:
DEFAULT_ICON_DIR = $(libexecdir)/icons
Maksud dari pengeditan file di atas adalah untk mengubah lokasi default
dari file cache.log, access.log, dan store.log agar ditempatkan di
dalam direktori
/var/log/squid, dan meletakkan pid (process identification) squid di
direktori /var/run, serta menyimpan direktori icons di
/usr/lib/squid/icons.
Menggunakan GNU malloc library untuk meningkatkan cache performance squid
————————————————————————-
- kopikan malloc.tar.gz ke direktori /var/tmp
# cp malloc.tar.gz /var/tmp
- ekstrak dan compile malloc
# cd /var/tmp
# tar zxvf malloc.tar.gz
# cd malloc
# export CC=egcs
# make
- kopikan library hasil kompilasi malloc (libmalloc.a) ke lib direktori linux anda
# cp libmalloc.a /usr/lib/libgnumalloc.a
- kopikan file malloc.h hasil kompilasi malloc ke direktori system include linux anda
# cp malloc.h /usr/include/gnumalloc.h
Kompilasi dan Optimasi Squid
—————————-
- Masuklah kembali ke direktori di mana terdapat source squid
# cd /var/tmp/squid-2.4.STABLE6
- Ketikkan command berikut di komputer anda:
CC=”egcs”
./configure
–prefix=/usr
–exec-prefix=/usr
–bindir=/usr/sbin
–libexecdir=/usr/lib/squid
–localstatedir=/var
–sysconfdir=/etc/squid
–enable-delay-pools
–enable-cache-digests
–enable-poll
–disable-ident-lookups
–enable-truncate
Command-command tersebut di atas akan sangat berarti sekali jika anda membaca help file yang disediakan ) (just type ./configure –help)
- Sekarang kita lakukan kompilasi dan instalasi squid, cukup ketikkan command-command berikut pada linux anda:
# make -f makefile
# make install
# mkdir -p /var/log/squid
# rm -rf /var/logs/
# chown squid.squid /var/log/squid/
# chmod 750 /var/log/squid/
# chmod 750 /cache/
# rm -f /usr/sbin/RunCache
# rm -f /usr/sbin/RunAccel
# strip /usr/sbin/squid
# strip /usr/sbin/client
# strip /usr/lib/squid/unlinkd
# strip /usr/lib/squid/cachemgr.cgi
Menggunakan script-script yang ada pada file floppy.tgz
——————————————————-
- ekstrak file floppy.tgz (misal ke /var/tmp)
# tar zxvf floppy.tgz
- kopikan script2 yg dibutuhkan oleh squid ke direktori yang sesuai
# cd /var/tmp/floppy
# cp /var/tmp/floppy/Squid/init.d/squid /etc/rc.d/init.d/
# cp /var/tmp/floppy/Squid/logrotate.d/squid /etc/logrotate.d/
Mengedit file konfigurasi squid
——————————-
- editlah file squid.conf yg terletak pada direktori /etc/squid/ dengan
text editor yg anda suka (misal vi, pico, joe, atau mcedit)
# vi /etc/squid/squid.conf
Pada artikel ini saya tidak akan membahas semua option yang ada pada
squid.conf, saya hanya akan membahas option-option yang dirasa penting
untuk menjalankan squid dan berpengaruh besar dalam optimasi squid.
http_port 3128
Option ini akan menentukan di port berapa squid akan berjalan (biasanya di port 3128 dan 8080)
icp_port 0
Option ini akan menentukan melalui port berapa squid akan mengirimkan dan menerima request ICP dari proxy cache tetangga.
cache_mem 32 MB
Option ini menentukan berapa besar memory yang akan digunakan oleh
squid, defaultnya adalah 8 MB yaitu default yang cocok untuk digunakan
pada
banyak sistem. Namun jika anda memiliki memory yang berlebih, maka
disarankan untuk menaikkannya. Ada yang berpendapat bahwa nilai ini
didapat dari sepertiga memory bebas bagi squid.
cache_dir ufs /cache 1600 4 256
Option pada cache_dir menentukan sistem penyimpanan seperti apa yang
akan digunakan (ufs), nama direktori tempat penyimpanan cache (/cache),
ukuran
disk dalam megabytes yang digunakan oleh direktori tempat penyimpanan
cache (1600 Mbytes), jumlah subdirektori pertama yang akan dibuat di
bawah /cache (4),
dan jumlah subdirektori kedua yang akan diciptakan di bawah subdirektori pertama tadi (256).
Nilai2 pada option cache_dir tadi harus disesuaikan dengan sistem yang
anda miliki, biasanya yang harus disesuaikan hanyalah tempat
penyimpanan cache, ukuran disk,
dan jumlah subdirektori yang akan dibuat. Mengenai angka2 tersebut,
dapat kita peroleh dari rumus yang telah disediakan oleh Mas Devshed
untuk optimasi sbb:
1. Gunakan 80% atau kurang dari setiap kapasitas cache direktori yang
telah kita siapkan. Jika kita mengeset ukuran cache_dir kita melebihi
nilai ini,
maka kita akan dapat melihat penurunan performansi squid.
2. Untuk menentukan jumlah subdirektori pertama yang akan dibuat, dapat menggunakan rumus ini:
x=Ukuran cache dir dalam KB (misal 6GB=~6,000,000KB) y=Average object size (gunakan saja 13KB)
z= Jumlah subdirektori pertama = (((x / y) / 256) / 256) * 2 = # direktori
Sebagai contoh, misal saya menggunakan 6 GB dari untuk /cache (setelah disisihkan 80% nya), maka:
6,000,000 / 13 = 461538.5 / 256 = 1802.9 / 256 = 7 * 2 = 14
maka baris cache_dir akan menjadi seperti ini: cache_dir ufs 6000 14 256
cache_store_log none
Option ini akan melog setiap aktivitas dari storage manager. Log ini
akan memperlihatkan objek-objek mana saja yang dikeluarkan dari cache,
dan objek-objek mana saja yang disimpan dan untuk brp lama objek
tersebut disimpan. Karena biasanya tidak ada gunanya untuk menganalisis
data ini, maka disarankan untuk didisable.
negative_ttl 2 minutes
Default dari option ini adalah 5 menit, tetapi Mas Moh. J. Kabir
menyarankan agar direndahkan menjadi 2 dan jika mungkin menjadi 1
menit. Kenapa settingannya seperti itu? Mas Moh. J. Kabir menjelaskan
bahwa kita menginginkan proxy yang kita miliki setransparan mungkin.
Jika seorang user mencari halaman web yang dia yakin itu ada, maka kita
pasti tidak ingin adanya waktu lag antara URL menuju dunia dan
kemampuan user untuk mengaksesnya.
cache_effective_user squid
cache_effective_group squid
Jika squid cache dijalankan oleh root, maka user yang akan
menjalankannya akan diubah sesuai UID/GID user yang disebutkan pada
option di atas. Pada contoh option di atas jika squid dijalankan oleh
root, maka squid cache akan dijalankan dengan UID/GID squid.
maximum_object_size 1024 KB
Dengan option ini, ukuran file maksimum yang disimpan oleh squid cache
bisa dibatasi. Dengan kata lain objek yang lebih besar dari bilangan
ini tidak akan disaved ke dalam disk yang sudah disisihkan buat cache
(misal /cache).
minimum_object_size 4 KB
Dengan option ini maka objek yang lebih kecil dari bilangan yang
disebutkan tidak akan disaved ke dalam disk yang sudah disisihkan buat
cache. Ada tambahan dari artikel yang ditulis Mas Jay bahwa ukuran file
minimum yang dicache bertujuan mengefektifkan filesystem di mana
biasanya ext2 diformat dengan 4 KB inode.
ftp_user hakiki@ciputnet.com This email address is being protected from spam bots, you need Javascript enabled to view it
Dengan option ini, maka ketika klien mengakses situs ftp anonymous,
email address di atas akan dikirim sebagai password bagi ftp server
anonymous.
reference_age 1 month
Dengan option ini, maka file cache yang tidak pernah diakses lagi
selama nilai parameter di atas, akan dihapus secara otomatis oleh squid.
acl PazzNET src 192.168.1.0/255.255.255.0
http_access allow PazzNET
http_access deny all
Option-option tersebut menentukan subnet mana yang boleh mengakses
proxy squid. Jika ada beberapa subnet, kita bisa menambahkan definisi
acl nya.
cache_mgr hakiki@ciputnet.com This email address is being protected from spam bots, you need Javascript enabled to view it
Email-address dari local cache manager yang akan menerima email jika
cache mati.Email ini pulalah yang akan muncul pada browser klien jika
terjadi suatu kesalahan ketika mengakses suatu web via proxy squid.
visible_hostname hakiki.ciputnet.com
Informasi ini dikirim sebagai footer pada saat pesan error tampil di layar browser klien.
half_closed_clients off
Beberapa klien dapat membatalkan koneksi TCP nya, dengan membiarkan
bagian penerimaaannya terbuka. Kadang-kadang squid tidak dapat
membedakan antara koneksi TCP yang half-closed dan full-closed.
Defaultnya, koneksi half-closed tetap terbuka sampai pembacaan dan
penulisan pada soket memunculkan pesan error. Ubahlah nilai ini ke off,
maka squid dengan serta merta akan menutup koneksi client jika tidak
ada data yang dibaca lagi.
Saran Mas Devshed yang lain untuk meningkatkan performance:
cache_swap_high 100%
cache_swap_low 80%
Setelah semua selesai dilakukan, cobalah start squid anda dan rasakanlah perbedaannya )
# /etc/rc.d/init.d/squid start
Jika ada error, jangan panik, carilah letak kesalahan dengan selalu memonitor log
# tail -f /var/log/messages
Jika masih ada error, berdo’alah, dan tanyakan pada forum2 linux di kota2 anda atau di #indolinux tentunya :)~
Pengembangan lebih lanjut untuk optimasi squid :
- Gunakan filesystem ReiserFS pada partisi cache direktori
- Gunakan 7200 RPM UDMA 66 drives atau fast (7200 atau 10k RPM) SCSI
drives.Tweak dengan patch Andre Hedrick’s Unified IDE patch.
- Besarkan RAM

Proxy Server Linux dengan Squid

in Linux, Networking, Server

104 Comments

Proxy Server LinuxBagi sebagian rekan-rekan yang mau membuat proxy server dengan Linux, atau bagi adik-adik Ilmu Komputer USD yang mau coba-coba belajar bikin proxy, saya ingin membagikan pengalaman kecil saya dalam membuat proxy menggunakan Linux. Meski banyak software untuk membuat proxy server, saya memilih squid karena paketnya sudah ter-include dalam distro yang saya gunakan (Fedora Core) dan hampir sebagian proxy server Linux menggunakan squid. Untuk spesifikasi hardware yang saya gunakan, dapat dilihat di artikel Proxy Server di tempat kerja saya. Proxy server tersebut menggunakan squid versi 2.6-12 pada distro Fedora Core 6 yang saya fungsikan sebagai:

1.

Menyimpan halaman web di proxy untuk mempercepat akses Internet.
2.

Akses kontrol Internet berdasarkan IP Address. Menggunakan 2 network yang berbeda (saya fungsikan juga sebagai router – dengan IP Forwarding), untuk ini, saya menggunakan 3 NIC pada 1 server.
3.

Blacklist daftar situs terlarang secara manual.
4.

Membatasi ukuran download File dengan ekstension tertentu dan hanya berlaku pada jam tertentu.
5.

Pesan Error dalam format Bahasa Indonesia.
6.

Rule untuk memperbolehkan akses Internet hanya protokol tertentu saja.

Langkah-langkah yang saya lakukan:

1. Instal aplikasi squid
2. Edit file konfigurasi squid
3. Buat direktori dan file blacklist untuk blacklist secara manual
4. Buat direktori dan file untuk pesan error dalam bahasa indonesia
5. Check konfigurasi firewall yang diterapkan di proxy
6. Jalankan servicenya
7. Test konfigurasi di proxy dan client

File konfigurasi squid: /etc/squid/squid.conf (versi saya)

#SQUID 2.6.STABLE12
#Author by: http://fxekobudi.net

# OPTION JARINGAN
# —————————————————————————–
http_port 3128
icp_port 0

# OPTION UKURAN CACHE
# ——————————————————————-
cache_mem 256 MB
cache_swap_low 94
cache_swap_high 96
maximum_object_size 16384 KB
minimum_object_size 4 KB
maximum_object_size_in_memory 2048 KB
fqdncache_size 1024
cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF

# DIREKTORI LOG DAN CACHE
# ——————————————————————
cache_dir aufs /var/spool/squid 9000 16 256
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log none

# TUNING CACHE PROXY
# ——————————————————————
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
negative_ttl 1 minutes

# TIMEOUT
# —————————————————————–
half_closed_clients off
# ————————————-
# Memblok situs terlarang (blacklist)secara manual
# ————————————-
acl noblacklist dstdomain “/etc/squid/blacklist/no-blacklist.txt”
acl katablacklist url_regex -i “/etc/squid/blacklist/kata-blacklist.txt”
acl domainblacklist dstdomain “/etc/squid/blacklist/domain-blacklist.txt”
acl ipblacklist dst “/etc/squid/blacklist/ip-blacklist.txt”

acl tdkbebasdownload time 08:00-13:00

# AKSES KONTROL
# ——————————————————————
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
# ————————————-
# Daftar IP address
# ————————————-
acl lab1 src 192.168.254.1-192.168.254.40/255.255.255.255
acl staf-it src 192.168.254.41-192.168.254.42/255.255.255.255
acl lab2 src 192.168.254.43-192.168.254.44/255.255.255.255
acl ruang1 src 192.168.1.1-192.168.1.8/255.255.255.255
acl ruang2 src 192.168.1.11-192.168.1.17/255.255.255.255

# ————————————-
# Memblok situs terlarang secara manual
# ————————————-
http_access allow noblacklist
http_access deny katablacklist
http_access deny domainblacklist
http_access deny ipblacklist

http_access allow manager localhost
http_access deny manager
# ————————————-
# Rule yang saya terapkan
# ————————————-
http_access allow lab1
http_access allow staf-it
http_access allow lab2
http_access allow ruang1
http_access allow ruang2

acl magic_words2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .tar.bz2 .bz2 .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .raw .wav .iso

# Cancel download if file is bigger than 2 MB = 2000×1024 byte = 2048000 byte
reply_body_max_size 2048000 allow magic_words2 tdkbebasdownload

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow all

# PARAMETER ADMINISTRATOR
# —————————————————————–
cache_mgr fxekobudi@gmail.com
cache_effective_user squid
cache_effective_group squid
visible_hostname proxy.fxekobudi.local

# PESAN ERROR DALAM BAHASA INDONESIA
# ——————————————————————–
error_directory /usr/share/squid/errors/Indonesian

Agar fungsi blacklist manual itu dapat digunakan, buat direktori berisi file-file disebutkan dalam blacklist manual:

# mkdir /etc/squid/blacklist
# cd /etc/squid/blacklist/
# vim no-blacklist.txt
# vim kata-blacklist.txt
# vim domain-blacklist.txt
# vim ip-blacklist.txt

Minimal dimasukkan satu item untuk masing-masing file tersebut, karena jika tidak, maka saat kita melihat error log squid sesaat setelah service dijalankan, akan ada pesan error tidak menemukan item pada file tersebut…

Selain itu, saya juga menyertakan konfigurasi untuk pesan Error dari Proxy squid dalam bentuk bahasa indonesia, agar user di tempat kerja saya lebih mudah memahami maksudnya… Ide pesan error ini kemudian menjadi inspirasi saya saat mengkonfigurasi redirect SquidGuard untuk mengarah kepada file yang sengaja saya buat di root direktori web server proxy.
Untuk melakukannya, tinggal copykan saja pesan Error dalam bahasa Inggris ke direktori lokasi pesan error berbahasa Indonesia.

# cp /usr/share/squid/errors/English /usr/share/squid/errors/Indonesian

trus terjemahkan file-filenya…

Untuk menjalankan servicenya, gunakan saja perintah:

# /sbin/service squid start

Oh ya, Anda juga perlu menambahkan di konfigurasi Firewall menggunakan Iptable agar client diperbolehkan mengakses Internet ini melalui proxy, request client ke proxy dengan IP address yang terdaftar diperbolehkan melalui port 3128 (atau 8080) tergantung konfigurasi yang Anda gunakan… Saya jadi ingat waktu pertama kali mencoba, koneksi internet di server pake proxy udah jalan, tapi kok clientnya ngga bisa akses, eh ternyata emang client belum diperbolehkan akses ke IP address dan portnya proxy… Hehe. Agar bisa akses ke proxy, rule iptable-nya untuk file /etc/sysconfig/iptables harus memuat rule ini: (saya pakai konfigurasi firewall bawaan Fedora Core)

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3128 -j ACCEPT

Untuk menerapkan IP forwarding, saya edit file /etc/sysctl.conf dan memberi nilai 1 (enable) untuk direktive:

net.ipv4.ip_forward = 0 menjadi net.ipv4.ip_forward = 1

Konfigurasi proxy ini saya gunakan sebagian ditempat kerja saya (YBHK dan persekolahan Tarsisius 1, Damai, Tarsisius 2, Vianney, dan Tarsisius Vireta) dengan beberapa tambahan fitur yang tidak dapat saya sebutkan disini… Dengan alasan keamanan. Hehe…

Compile Squid 2.7 stable 9 di Ubuntu

Sebelum menginstall ada baiknya melakukan persiapan dulu

Persiapan :
1. PC yang memenuhi spek 32 bit tentunya
2. Backup squid.conf (kalau ada)
3. Minuman penambah smangat

Pastikan compilernya udah terinstal semua
sudo apt-get install gcc
sudo apt-get install build-essential

Jalankan perintah berikut di terminal untuk melihat informasi CPU lo
cat /proc/cpuinfo

untuk pengguna AMD 64 bit bisa di lihat disini , sedangkan pengguna Intel disini
Catat informasi CHOST dan CFLAGS nya (sesuai dengan informasi cpu lo di ubuntu tadi), contoh gw menggunakan intel celeron M, maka gw memperoleh informasi CHOST dan CFLAGSnya

CHOST=”i686-pc-linux-gnu”
CFLAGS=”-march=pentium-m -O2 -pipe -fomit-frame-pointer”

dowload squid 2.7stable9 dengan perintah :
wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.bz2

lalu ekstrak dan masuk ke foldernya

tar xvjf squid-2.7.STABLE9.tar.bz2
cd squid-2.7.STABLE9

ok sekarang dimulai tahap compile nya

CHOST="i686-pc-linux-gnu" \
CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer" \
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid \
--localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs \
--enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp \
--enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files \
--enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536

WARNING !!!

* diatas adalah contoh, nilai CHOST, CFLAGS sesuai dengan informasi CPU lo !
* nilai ./configure hukumnya sunnah artinya bisa sama dengan yang diatas atau jika lo ingin berkreasi ketik ./configure –help dan lihat option2 lainnya
* jangan sampai salah mengetikkan ejaan, contoh enable-err-languages menggunakan “s” sedangkan yang di enable-default-err-language tidak menggunakan “s” tanya dah ma orang bule

Install dah, ketik perintah berikut di terminal
sudo make
sudo make install

segitu aja dl yah..konfigurasinya

Ubuntu - Installing an HTTP proxy server (Squid)

1.Installing the proxy

To install Squid type the following command in a terminal:

sudo aptitude install squid


2.Configuring the proxy

Configuration of Squid is done through the editing of the following file: /etc/squid/squid.conf
To edit this file ,type Alt+F2 and enter the following command:

gksu gedit /etc/squid/squid.conf


2.1.Naming the proxy

Its important that Squid knows the name of the machine. To do this, locate the line visible_hostname.
For example, if the machine called ubuntu insert:

visible_hostname ubuntu


2.2 Choosing the Port

By default, the proxy server will use port 3128. To choose another port, locate the line:


http_port 3128



and change the port number, for example:

http_port 3177


2.3.Choosing the interface

By default the proxy server will listen on all interfaces. For security reasons, its better to put in on your local network only.
For example, if the network card connected to your LAN, has IP 10.0.0.1, change the line:

http_port 10.0.0.1:3177


2.4. Setting access rights and priorities

By default, nobody is allowed to connect to the proxy server. (Only from your machine itself)
A list of permissions must be created.

For example, we will define a group encompassing the local network.

Find the line beginning with acl localhost...
At the end of the section, add:

acl lanhome src 10.0.0.0/255.255.255.0



(lanhome is a random name chosen).


2.5. Authorizing access to group

Now that the group is defined, we will authorize to use the proxy.
Locate the line http_access allow ...
and add below (before the line http_access deny all):

http_access allow lanhome




2.6. Allow the use non-standard ports

By default, Squid allows HTTP traffic only on specific ports (80, etc.).

* This can cause problems on websites using other ports.
* Example: http://toto.com:81/images/titi.png will be blocked by Squid.
* To avoid this deadlock, find the line:
o http_access deny! Safe_ports
* and the edit it to:
o # http_access deny! Safe_ports


3.Starting the Proxy

Restart the proxy to take apply the modifications you made. Type:
sudo /etc/init.d/squid restart

From there, the proxy should work based upon your requirements. Just configure the software using the proxy and all should run smoothly.
Miscellaneous

Server logs

The proxy logs are located in: /var/log/squid/access.log
Changing the size of the cache

* The Squid cache is enabled by default, which helps accelerate the loading of some pages.
* The default allocated size is 100 MB(found in /var/spool/squid)
* To change its size,edit the /etc/squid/squid.conf file.
* Find the line:
o # cache_dir ufs /var/spool/squid 100 16 256
* Edit it. You can change the value 100 by what you want (eg 200 for 200 MB):
o cache_dir ufs /var/spool/squid 200 16 256


Functions and additional modules

Squid is full of options and modules:

* Prefetch (to preload the pages and speed up navigation).
* Antivirus filters, AntiPopUp, etc..
* Access control via proxy login and password.
* Access control based upon hours.


To do this, open Synaptic, and click on Search and enter squid to find the modules related to Squid.
Consult the documentation for each module and the Squid manual for more information.

Instalasi Webmin di Ubuntu Server 9.10 Karmic Koala

1. Instalasi Paket
- root@ubuntu:/home/madhy# aptitude install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

2. Download Paket Webmin
- root@ubuntu:/home/madhy# wget -c http://nchc.dl.sourceforge.net/project/webadmin/webmin/1.500/webmin_1.500_all.deb

3. Instal Paket Webmin
- root@ubuntu:/home/madhy# dpkg -i webmin_1.500_all.deb
Selecting previously deselected package webmin.
(Reading database ... 45303 files and directories currently installed.)
Unpacking webmin (from webmin_1.500_all.deb) ...
Setting up webmin (1.500) ...
Webmin install complete. You can now login to https://ubuntu:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.

4. Setelah Instal Paket Webmin selesai restart Ubuntu Server.
- root@ubuntu:/home/madhy# reboot

5. Untuk dapat menjalankan webmin, kita harus menggunakan web browser dan masukan URL berikut ini:
- https://your_server_ip:10000/ (ex : https://192.168.1.254:10000/)
- Masukkan username & password login anda.
6. Untuk informasi lebih lengkap, buka situs ini www.webmin.com.

Moga bermanfaat buat teman-teman yang ingin mengkonfigurasi server ubuntu melalui WEB GUI...

CHOST & CFLAGS

Mobile Pentium 4-M (Northwood)

vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Mobile Intel(R) Pentium(R) 4 - M CPU X.XXGHz

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium 4

vendor_id : GenuineIntel
cpu family : 15
model : 0 or 1 or 2
model name : Intel(R) Pentium(R) 4 CPU XXXXMHz

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Pentium D 8xx / 9xx

vendor_id : GenuineIntel
cpu family : 15
model : 4, 6
model name : Intel(R) Pentium(R) D CPU x.xxGHz

32-bit profile (x86):

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

64-bit profile (amd64):

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"