Pages

Desain Grafis Nur Afandi
keep watching Arif Nugraha
Table Cell Table Cell
ooooll

4 Desember 2010

squid.conf warnet

#Adalah port http yang digunakan oleh squid
#Port 3128 adalah defaultnya, ada pilihan lain yaitu
#port 8080, jadi silakan saja anda memilih yang mana,
#dalam hal ini dipilih port 3128 saja
http_port 3128 transparent

#Adalah port yang digunakan squid untuk menerima dan
#mengirim permintaan/request ICP dari dan ke cache
#tetangga ( lain squid) atau dengan kata lain saling
#bertukar informasi cache antar squid.Jadi jika hanya satu squid,
#lebih baik di off-kan. Untuk menonaktifkan berikan nilai "0"
icp_port 3130

acl QUERY urlpath_regex cgi-bin \? \.php$ \.asp$ \.shtml$ \.cfm$ \.cfml$ \.phtml$ \.php3$
acl nocache-domain dstdomain .mail.yahoo.com .login.yahoo.com

#Object yang diminta client tidak perlu disimpan ke hardisk
no_cache deny QUERY
no_cache deny nocache-domain

#Permintaan yang ditangani langsung ke server origin
always_direct allow QUERY
always_direct allow nocache-domain

#blokir site purno ^^
#acl xxx1 dstdomain .playboy.com .gay.com .penthouse.com
#acl xxx2 dstdomain "/data/daftar_site_porno.txt
#acl xxx3 dstdom_regex sex xxx lolita lesbian gay
#http_access deny xxx1
#http_access deny xxx2
#http_access deny xxx3

acl mp3 urlpath_regex \.mp3$
acl exe urlpath_regex \.exe$
acl zip urlpath_regex \.zip$
acl dat urlpath_regex \.dat$
acl avi urlpath_regex \.avi$
acl 3gp urlpath_regex \.3gp$

#data mp2, exe, zip, dat, avi, 3gp tidak disimpan di cache hardisk
no_cache deny mp3
no_cache deny exe
no_cache deny zip
no_cache deny dat
no_cache deny avi
no_cache deny 3gp

#blokir akses layer netwok lan dari ip 192.168.0.0/24
#acl network_lan dst 192.168.0.0/24
#http_access deny mp3
#http_access deny exe
#http_access deny zip
#http_access deny dat
#http_access deny avi
#http_access deny 3gp


#cache_mem digunakan untuk menentukan besaranya cache memori
#yang digunakan squid untuk melakukan caching objects
#( In-Transit objects, Hot Objects, Negative-Cached objects).
$Sebaikanya besarnya sekitar 1/3 RAM yang digunakan
cache_mem 10 MB

#Untuk menentukan besarnya object yang akan disimpan dalam hardisk,
#setting diatas berarti hanya object yang berukuran diantara
#8 KB s/d 1024 KB saja yang akan disimpan, sedang
#object yang berukuran dibawah 8 KB ataupun object yang lebih besar dari 10240 KB
#tidak akan disimpan
cache_swap_low 90
cache_swap_high 95

#Untuk menentukan besar object maksimum yang akan diusahakan untuk di caching pada cache
#memori,semakin besar adalah semakin baik karena sangat membantu untuk mengoptimasi
#squid melakukan caching object (lihat cache_mem)
maximum_object_size 40 MB
maximum_object_size_in_memory 8 MB

#Jangan lupa buatlah direktori /home/squid dan ubah kepemilikannya
#( dalam hal ini adalah dimiliki oleh yang menjalankan squid yaitu user : squid )
cache_dir ufs /home/squid 10240 32 512
cache_access_log /usr/local/squid/access.log
cache_log /usr/local/squid/cache.log
cache_store_log none

acl all src 0.0.0.0/0.0.0.0
acl lan_bagong src 192.168.0.0/24
acl private src 192.168.155.0/24
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

#port yang diijinkan untuk di request
acl SSL_ports port 443 563
acl SSL_ports port 2083 2096
acl Safe_ports port 80 # http
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 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 631 # cups
acl Safe_ports port 777 # multiling http
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
acl FTP proto FTP

#lan_bagong,privat dan localhost yang telah didefinisikan diatas diijinkan untuk mengakses
#data melalui port http, sedang selain itu (all) akan ditolak.
http_access allow lan_bagong
http_access allow private
http_access allow localhost
http_access deny all

#Digunakan untuk menolak request port http dan koneksi
#untuk port yang tidak diketahui (selain port yang didefinisikan diatas [Safe_ports]).
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

#lan_bagong,privat dan localhost yang telah didefinisikan diatas diijinkan untuk mengakses
#data melalui port icp sedang selain itu (all) akan ditolak.
icp_access allow lan_bagong
icp_access allow private
icp_access allow localhost
icp_access deny all

#untuk mengkonfigurasi http://192.168.xxx.x/cgi-bin/cachemgr.cgi dengan username cachemgr dan password xxxxx
#diubuntu server install dulu cachemgr dengan comman $sudo apt-get install squid-cgi
acl cachemgr proto cache_object
http_access allow cachemgr lan_bagong
http_access allow cachemgr private
http_access allow cachemgr localhost
http_access deny cachemgr all
cachemgr_passwd xxxxx info stats/objects
cachemgr_passwd xxxxx all

#digunakan untuk menentukan user dan group yang menjalankan squidS dalam hal ini user yang
#menjalankan squid adalah squid dan groupnya juga squid
cache_effective_user squid
cache_effective_group squid

#digunakan untuk menginformasikan kontak kepada client jika mengalami gagal browsing
visible_hostname http://bagongnet.nasrulkurniawan.net
cache_mgr zenohoeda@myself.com

#menampilkan ip address dari showip.net dan nama hostname
forwarded_for off


contoh squid.conf yang bs di terapkan di sebuah warnet / mesin squid kita sendiri:


cache_effective_user proxy
http_port 8080 transparent

cache_mem 8 MB
maximum_object_size_in_memory 128 KB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 1024 MB
quick_abort_min -1 KB

pid_filename /var/run/squid.pid
cache_dir aufs /var/spool/squid 10000 16 256

cache_access_log daemon:/var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log daemon:/var/log/squid/store.log
dns_nameservers 202.6.233.11 202.6.233.34
cache_swap_log /var/log/squid/swap.state
emulate_httpd_log off
hosts_file /etc/hosts
ftp_passive on
ftp_sanitycheck on

negative_ttl 1 minutes
half_closed_clients off
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 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
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 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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl blitz src 10.0.0.0/16
acl localhost src 192.168.0.0/24
acl padinet1 src 202.6.238.0/24 202.6.233.0/24
http_access allow localhost
http_access allow blitz
http_access allow padinet1
http_access deny all
http_reply_access allow all
icp_access allow all
acl store_rewrite_list dstdomain mt.google.com mt0.google.com mt1.google.com mt2.google.com
acl store_rewrite_list dstdomain mt3.google.com
acl store_rewrite_list dstdomain kh.google.com kh0.google.com kh1.google.com kh2.google.com
acl store_rewrite_list dstdomain kh3.google.com
acl store_rewrite_list dstdomain kh.google.com.au kh0.google.com.au kh1.google.com.au
acl store_rewrite_list dstdomain kh2.google.com.au kh3.google.com.au
acl store_rewrite_list dstdomain khm.google.com khm0.google.com khm1.google.com khm2.google.com
acl store_rewrite_list dstdomain khm3.google.com
acl store_rewrite_list dstdomain khm.google.com.au khm0.google.com.au khm1.google.com.au
acl store_rewrite_list dstdomain khm2.google.com.au khm3.google.com.au
acl store_rewrite_list dstdomain .googlehosted.com .books.google.com
acl store_rewrite_list dstdomain .youtube.com
acl store_rewrite_regex urlpath_regex -i ^/get_video\?
acl store_rewrite_regex urlpath_regex -i ^/videodownload\?
storeurl_access allow store_rewrite_list
storeurl_access allow store_rewrite_regex
storeurl_access deny all
storeurl_rewrite_program /bin/storeurl_rewrite
storeurl_rewrite_children 10
storeurl_rewrite_concurrency 100

cache allow all
refresh_pattern -i \.(ps|art|wma|wmf|ogg|3gp|wmv|asf|avi|viv|wav|mov|mid|js|css|htm|rm|txt|zip|mpeg|mpg|z|gz|bz2|tar|rpm|cab|dat|ad|msi|gsz|rar|bin|tbz|tgz|com|exe|gif|ico|jpeg|tif|bmp|jpg|png|swf|mp3|svg|pdf|html|mspx|msxml|krg|xfs)$ 10080 0% 10080 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern -i (mt|kh|tb).*\.google.com\/.* 604800 0% 604800 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern -i keyhole.com 604800 0% 604800 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern -i ytimg.com 604800 0% 604800 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern -i googlehosted.com 604800 0% 604800 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern -i youtube.com 604800 0% 604800 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern -i ^http://(.*?)/get_video\? 604800 90% 999999 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern -i ^http://(.*?)/videodownload\? 604800 90% 999999 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private ignore-auth
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern \.ini$ 0 0% 0
refresh_pattern cgi-bin 0 0% 0
refresh_pattern \? 0 0% 0
refresh_pattern . 0 20% 4320

cache_mgr zenohoeda@myself.net.id
visible_hostname proxy.zen.myself.net.id
reload_into_ims on
pipeline_prefetch on



Artikel Terkait: