Senin, 02 April 2012

Instalasi squid di windows

Instalasi squid di windows

 
 
 
 
 
 
Rate This
Langkah – langkah yang perlu dilakukan adalah :
1. Siapkan SQUID nya. Disini saya menggunakan squid-2.7.STABLE6-standard. Silahkan download.

2. Setelah itu Ekstrak menggunakan Winzip / WinRAR ke direktori C:
Sehingga kalau dibuka kalau dibuka C:squid, akan nampak direktori – direktori seperti bin, docs, etc, libexec, dan semua direktori yang seharusnya ada di dalam folder squid.

3. Langkah berikutnya adalah tahap penggantian nama pada file cachemgr.conf.default, dan mime.conf.default yang ada pada direktori C:squidetc menjadi :
cachemgr.conf.default -> cachemgr.conf
mime.conf.default -> mime.conf
NB : Cukup kedua nama itu saja yang direname, sisanya tidak.

4. Apabila sudah direname, sekarang tahap penginstallasian file squid.conf dimana file itu merupakan file konfigurasi pada SQUID. Pertama buka notepad, kemudian copy dan paste code dibawah ini ke dalam notepad, dan save dengan nama squid.conf pada direktori C:squidetc

##################################################
# SQUID.CONF #
##################################################
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 192.168.0.0/16
acl Safe_ports port 80 21 43 70 210 280 488 591 777 102-65535
acl SSL_ports port 443
acl CONNECT method CONNECT
http_access allow localhost
http_access allow localnet
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all
icp_access allow localnet
icp_access deny all
reply_body_max_size 0 allow all
# NETWORK OPTIONS
# —————————————————————————–
http_port 3128
icp_port 3130
# OPTIONS
# —————————————————————————–
dead_peer_timeout 10 seconds
hierarchy_stoplist cgi-bin ?
peer_connect_timeout 120 seconds
# MEMORY CACHE
#—————————————————————————–
cache_mem 32 MB
maximum_object_size_in_memory 80 KB
memory_replacement_policy lru
# DISK CACHE OPTIONS
# —————————————————————————–
cache_replacement_policy lru
cache_dir ufs c:/squid/var/cache 350 16 256
store_dir_select_algorithm least-load
minimum_object_size 0 KB
maximum_object_size 4096 KB
cache_swap_low 90
cache_swap_high 95
# LOGFILE OPTIONS
# —————————————————————————–
access_log c:/squid/var/logs/access.log squid
# logfile_daemon c:/squid/libexec/logfile-daemon.exe
cache_log c:/squid/var/logs/cache.log
cache_store_log c:/squid/var/logs/store.log
mime_table c:/squid/etc/mime.conf
pid_filename c:/squid/var/logs/squid.pid
debug_options ALL,1
# OPTIONS FOR FTP GATEWAYING
# —————————————————————————–
ftp_user Squid@
ftp_list_width 32
ftp_passive on
ftp_sanitycheck on
# OPTIONS FOR TUNING THE CACHE
# —————————————————————————–
refresh_pattern cgi-bin 1 20% 2
refresh_pattern .asp$ 1 20% 2
refresh_pattern .acgi$ 1 20% 2
refresh_pattern .cgi$ 1 20% 2
refresh_pattern .pl$ 1 20% 2
refresh_pattern .shtml$ 1 20% 2
refresh_pattern .php3$ 1 20% 2
refresh_pattern ? 1 20% 2
refresh_pattern .gif$ 10080 90% 43200 reload-into-ims
refresh_pattern .jpg$ 10080 90% 43200 reload-into-ims
refresh_pattern .bom.gov.au 30 20% 120 reload-into-ims
refresh_pattern .html$ 480 50% 22160 reload-into-ims
refresh_pattern .htm$ 480 50% 22160 reload-into-ims
refresh_pattern .class$ 10080 90% 43200 reload-into-ims
refresh_pattern .zip$ 10080 90% 43200 reload-into-ims
refresh_pattern .jpeg$ 10080 90% 43200 reload-into-ims
refresh_pattern .mid$ 10080 90% 43200 reload-into-ims
refresh_pattern .shtml$ 480 50% 22160 reload-into-ims
refresh_pattern .exe$ 10080 90% 43200 reload-into-ims
refresh_pattern .thm$ 10080 90% 43200 reload-into-ims
refresh_pattern .wav$ 10080 90% 43200 reload-into-ims
refresh_pattern .txt$ 10080 90% 43200 reload-into-ims
refresh_pattern .cab$ 10080 90% 43200 reload-into-ims
refresh_pattern .au$ 10080 90% 43200 reload-into-ims
refresh_pattern .mov$ 10080 90% 43200 reload-into-ims
refresh_pattern .xbm$ 10080 90% 43200 reload-into-ims
refresh_pattern .ram$ 10080 90% 43200 reload-into-ims
refresh_pattern .avi$ 10080 90% 43200 reload-into-ims
refresh_pattern .chtml$ 480 50% 22160 reload-into-ims
refresh_pattern .thb$ 10080 90% 43200 reload-into-ims
refresh_pattern .dcr$ 10080 90% 43200 reload-into-ims
refresh_pattern .bmp$ 10080 90% 43200 reload-into-ims
refresh_pattern .phtml$ 480 50% 22160 reload-into-ims
refresh_pattern .mpg$ 10080 90% 43200 reload-into-ims
refresh_pattern .pdf$ 10080 90% 43200 reload-into-ims
refresh_pattern .art$ 10080 90% 43200 reload-into-ims
refresh_pattern .swf$ 10080 90% 43200 reload-into-ims
refresh_pattern .mp3$ 10080 90% 43200 reload-into-ims
refresh_pattern .ra$ 10080 90% 43200 reload-into-ims
refresh_pattern .spl$ 10080 90% 43200 reload-into-ims
refresh_pattern .viv$ 10080 90% 43200 reload-into-ims
refresh_pattern .doc$ 10080 90% 43200 reload-into-ims
refresh_pattern .gz$ 10080 90% 43200 reload-into-ims
refresh_pattern .Z$ 10080 90% 43200 reload-into-ims
refresh_pattern .tgz$ 10080 90% 43200 reload-into-ims
refresh_pattern .tar$ 10080 90% 43200 reload-into-ims
refresh_pattern .vrm$ 10080 90% 43200 reload-into-ims
refresh_pattern .vrml$ 10080 90% 43200 reload-into-ims
refresh_pattern .aif$ 10080 90% 43200 reload-into-ims
refresh_pattern .aifc$ 10080 90% 43200 reload-into-ims
refresh_pattern .aiff$ 10080 90% 43200 reload-into-ims
refresh_pattern .arj$ 10080 90% 43200 reload-into-ims
refresh_pattern .c$ 10080 90% 43200 reload-into-ims
refresh_pattern .cpt$ 10080 90% 43200 reload-into-ims
refresh_pattern .dir$ 10080 90% 43200 reload-into-ims
refresh_pattern .dxr$ 10080 90% 43200 reload-into-ims
refresh_pattern .hqx$ 10080 90% 43200 reload-into-ims
refresh_pattern .jpe$ 10080 90% 43200 reload-into-ims
refresh_pattern .lha$ 10080 90% 43200 reload-into-ims
refresh_pattern .lzh$ 10080 90% 43200 reload-into-ims
refresh_pattern .midi$ 10080 90% 43200 reload-into-ims
refresh_pattern .movie$ 10080 90% 43200 reload-into-ims
refresh_pattern .mp2$ 10080 90% 43200 reload-into-ims
refresh_pattern .mpe$ 10080 90% 43200 reload-into-ims
refresh_pattern .mpeg$ 10080 90% 43200 reload-into-ims
refresh_pattern .mpga$ 10080 90% 43200 reload-into-ims
refresh_pattern .pl$ 10080 90% 43200 reload-into-ims
refresh_pattern .ppt$ 10080 90% 43200 reload-into-ims
refresh_pattern .ps$ 10080 90% 43200 reload-into-ims
refresh_pattern .qt$ 10080 90% 43200 reload-into-ims
refresh_pattern .qtm$ 10080 90% 43200 reload-into-ims
refresh_pattern .ras$ 10080 90% 43200 reload-into-ims
refresh_pattern .sea$ 10080 90% 43200 reload-into-ims
refresh_pattern .sit$ 10080 90% 43200 reload-into-ims
refresh_pattern .tif$ 10080 90% 43200 reload-into-ims
refresh_pattern .tiff$ 10080 90% 43200 reload-into-ims
refresh_pattern .snd$ 10080 90% 43200 reload-into-ims
refresh_pattern .wrl$ 10080 90% 43200 reload-into-ims
refresh_pattern ^ftp:// 480 60% 22160
refresh_pattern ^gopher:// 30 20% 120
refresh_pattern . 480 50% 22160 reload-into-ims
##
quick_abort_min 16 KB
quick_abort_max 16 KB
quick_abort_pct 95
negative_ttl 5 minutes
positive_dns_ttl 6 hours
# HTTP OPTIONS
# —————————————————————————–
acl shoutcast rep_header X-HTTP09-First-Line ^ICYs[0-9]
upgrade_http0.9 deny shoutcast
via on
cache_vary on
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
# TIMEOUTS
# —————————————————————————–
read_timeout 15 minutes
request_timeout 5 minutes
persistent_request_timeout 2 minutes
client_lifetime 1 day
# ADMINISTRATIVE PARAMETERS
# —————————————————————————–
cache_mgr dxzstudioz
# cache_effective_user nobody
visible_hostname cache.localhost.net
# PERSISTENT CONNECTION
# —————————————————————————–
client_persistent_connections on
server_persistent_connections on
# INTERNAL ICON
# —————————————————————————–
# icon_directory c:/squid/share/icons
# global_internal_static on
# short_icon_urls off
# DNS OPTIONS
# —————————————————————————–
check_hostnames off
allow_underscore on
hosts_file %SystemRoot%system32driversetchosts
# TAG: ipcache_size (number of entries)
# TAG: ipcache_low (percent)
# TAG: ipcache_high (percent)
# The size, low-, and high-water marks for the IP cache.
#
#Default:
# ipcache_size 1024
# ipcache_low 90
# ipcache_high 95
fqdncache_size 1024
# MISCELLANEOUS
# —————————————————————————–
memory_pools on
memory_pools_limit 8 MB
reload_into_ims on
coredump_dir c:/squid/var/cache



##################################################
# SQUID.CONF #
##################################################
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 192.168.0.0/16
acl Safe_ports port 80 21 43 70 210 280 488 591 777 102-65535
acl SSL_ports port 443
acl CONNECT method CONNECT
http_access allow localhost
http_access allow localnet
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all
icp_access allow localnet
icp_access deny all
reply_body_max_size 0 allow all
# NETWORK OPTIONS
# —————————————————————————–
http_port 3128
icp_port 3130
# OPTIONS
# —————————————————————————–
dead_peer_timeout 10 seconds
hierarchy_stoplist cgi-bin ?
peer_connect_timeout 120 seconds
# MEMORY CACHE
#—————————————————————————–
cache_mem 32 MB
maximum_object_size_in_memory 80 KB
memory_replacement_policy lru
# DISK CACHE OPTIONS
# —————————————————————————–
cache_replacement_policy lru
cache_dir ufs c:/squid/var/cache 350 16 256
store_dir_select_algorithm least-load
minimum_object_size 0 KB
maximum_object_size 4096 KB
cache_swap_low 90
cache_swap_high 95
# LOGFILE OPTIONS
# —————————————————————————–
access_log c:/squid/var/logs/access.log squid
# logfile_daemon c:/squid/libexec/logfile-daemon.exe
cache_log c:/squid/var/logs/cache.log
cache_store_log c:/squid/var/logs/store.log
mime_table c:/squid/etc/mime.conf
pid_filename c:/squid/var/logs/squid.pid
debug_options ALL,1
# OPTIONS FOR FTP GATEWAYING
# —————————————————————————–
ftp_user Squid@
ftp_list_width 32
ftp_passive on
ftp_sanitycheck on
# OPTIONS FOR TUNING THE CACHE
# —————————————————————————–
refresh_pattern cgi-bin 1 20% 2
refresh_pattern .asp$ 1 20% 2
refresh_pattern .acgi$ 1 20% 2
refresh_pattern .cgi$ 1 20% 2
refresh_pattern .pl$ 1 20% 2
refresh_pattern .shtml$ 1 20% 2
refresh_pattern .php3$ 1 20% 2
refresh_pattern ? 1 20% 2
refresh_pattern .gif$ 10080 90% 43200 reload-into-ims
refresh_pattern .jpg$ 10080 90% 43200 reload-into-ims
refresh_pattern .bom.gov.au 30 20% 120 reload-into-ims
refresh_pattern .html$ 480 50% 22160 reload-into-ims
refresh_pattern .htm$ 480 50% 22160 reload-into-ims
refresh_pattern .class$ 10080 90% 43200 reload-into-ims
refresh_pattern .zip$ 10080 90% 43200 reload-into-ims
refresh_pattern .jpeg$ 10080 90% 43200 reload-into-ims
refresh_pattern .mid$ 10080 90% 43200 reload-into-ims
refresh_pattern .shtml$ 480 50% 22160 reload-into-ims
refresh_pattern .exe$ 10080 90% 43200 reload-into-ims
refresh_pattern .thm$ 10080 90% 43200 reload-into-ims
refresh_pattern .wav$ 10080 90% 43200 reload-into-ims
refresh_pattern .txt$ 10080 90% 43200 reload-into-ims
refresh_pattern .cab$ 10080 90% 43200 reload-into-ims
refresh_pattern .au$ 10080 90% 43200 reload-into-ims
refresh_pattern .mov$ 10080 90% 43200 reload-into-ims
refresh_pattern .xbm$ 10080 90% 43200 reload-into-ims
refresh_pattern .ram$ 10080 90% 43200 reload-into-ims
refresh_pattern .avi$ 10080 90% 43200 reload-into-ims
refresh_pattern .chtml$ 480 50% 22160 reload-into-ims
refresh_pattern .thb$ 10080 90% 43200 reload-into-ims
refresh_pattern .dcr$ 10080 90% 43200 reload-into-ims
refresh_pattern .bmp$ 10080 90% 43200 reload-into-ims
refresh_pattern .phtml$ 480 50% 22160 reload-into-ims
refresh_pattern .mpg$ 10080 90% 43200 reload-into-ims
refresh_pattern .pdf$ 10080 90% 43200 reload-into-ims
refresh_pattern .art$ 10080 90% 43200 reload-into-ims
refresh_pattern .swf$ 10080 90% 43200 reload-into-ims
refresh_pattern .mp3$ 10080 90% 43200 reload-into-ims
refresh_pattern .ra$ 10080 90% 43200 reload-into-ims
refresh_pattern .spl$ 10080 90% 43200 reload-into-ims
refresh_pattern .viv$ 10080 90% 43200 reload-into-ims
refresh_pattern .doc$ 10080 90% 43200 reload-into-ims
refresh_pattern .gz$ 10080 90% 43200 reload-into-ims
refresh_pattern .Z$ 10080 90% 43200 reload-into-ims
refresh_pattern .tgz$ 10080 90% 43200 reload-into-ims
refresh_pattern .tar$ 10080 90% 43200 reload-into-ims
refresh_pattern .vrm$ 10080 90% 43200 reload-into-ims
refresh_pattern .vrml$ 10080 90% 43200 reload-into-ims
refresh_pattern .aif$ 10080 90% 43200 reload-into-ims
refresh_pattern .aifc$ 10080 90% 43200 reload-into-ims
refresh_pattern .aiff$ 10080 90% 43200 reload-into-ims
refresh_pattern .arj$ 10080 90% 43200 reload-into-ims
refresh_pattern .c$ 10080 90% 43200 reload-into-ims
refresh_pattern .cpt$ 10080 90% 43200 reload-into-ims
refresh_pattern .dir$ 10080 90% 43200 reload-into-ims
refresh_pattern .dxr$ 10080 90% 43200 reload-into-ims
refresh_pattern .hqx$ 10080 90% 43200 reload-into-ims
refresh_pattern .jpe$ 10080 90% 43200 reload-into-ims
refresh_pattern .lha$ 10080 90% 43200 reload-into-ims
refresh_pattern .lzh$ 10080 90% 43200 reload-into-ims
refresh_pattern .midi$ 10080 90% 43200 reload-into-ims
refresh_pattern .movie$ 10080 90% 43200 reload-into-ims
refresh_pattern .mp2$ 10080 90% 43200 reload-into-ims
refresh_pattern .mpe$ 10080 90% 43200 reload-into-ims
refresh_pattern .mpeg$ 10080 90% 43200 reload-into-ims
refresh_pattern .mpga$ 10080 90% 43200 reload-into-ims
refresh_pattern .pl$ 10080 90% 43200 reload-into-ims
refresh_pattern .ppt$ 10080 90% 43200 reload-into-ims
refresh_pattern .ps$ 10080 90% 43200 reload-into-ims
refresh_pattern .qt$ 10080 90% 43200 reload-into-ims
refresh_pattern .qtm$ 10080 90% 43200 reload-into-ims
refresh_pattern .ras$ 10080 90% 43200 reload-into-ims
refresh_pattern .sea$ 10080 90% 43200 reload-into-ims
refresh_pattern .sit$ 10080 90% 43200 reload-into-ims
refresh_pattern .tif$ 10080 90% 43200 reload-into-ims
refresh_pattern .tiff$ 10080 90% 43200 reload-into-ims
refresh_pattern .snd$ 10080 90% 43200 reload-into-ims
refresh_pattern .wrl$ 10080 90% 43200 reload-into-ims
refresh_pattern ^ftp:// 480 60% 22160
refresh_pattern ^gopher:// 30 20% 120
refresh_pattern . 480 50% 22160 reload-into-ims
##
quick_abort_min 16 KB
quick_abort_max 16 KB
quick_abort_pct 95
negative_ttl 5 minutes
positive_dns_ttl 6 hours
# HTTP OPTIONS
# —————————————————————————–
acl shoutcast rep_header X-HTTP09-First-Line ^ICYs[0-9]
upgrade_http0.9 deny shoutcast
via on
cache_vary on
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
# TIMEOUTS
# —————————————————————————–
read_timeout 15 minutes
request_timeout 5 minutes
persistent_request_timeout 2 minutes
client_lifetime 1 day
# ADMINISTRATIVE PARAMETERS
# —————————————————————————–
cache_mgr dxzstudioz
# cache_effective_user nobody
visible_hostname cache.localhost.net
# PERSISTENT CONNECTION
# —————————————————————————–
client_persistent_connections on
server_persistent_connections on
# INTERNAL ICON
# —————————————————————————–
# icon_directory c:/squid/share/icons
# global_internal_static on
# short_icon_urls off
# DNS OPTIONS
# —————————————————————————–
check_hostnames off
allow_underscore on
hosts_file %SystemRoot%system32driversetchosts
# TAG: ipcache_size (number of entries)
# TAG: ipcache_low (percent)
# TAG: ipcache_high (percent)
# The size, low-, and high-water marks for the IP cache.
#
#Default:
# ipcache_size 1024
# ipcache_low 90
# ipcache_high 95
fqdncache_size 1024
# MISCELLANEOUS
# —————————————————————————–
memory_pools on
memory_pools_limit 8 MB
reload_into_ims on
coredump_dir c:/squid/var/cache

NB :
- Code – code diatas adalah konfigurasi standard, yang dibuat oleh hans@arc.itb.ac.id
- Konfigurasi squid.conf diatas adalah configurasi standard, sehingga dapat diubah – ubah sesuai dengan keinginan
- Konfigurasi diatas memiliki kapasitas 350 MB, yang dapat anda tambah sendiri.

5. Setelah melakukan instalasi file squid.conf diatas sekarang kita dapat membuat direktori – direktori cache sesuai dengan permintaan squid.conf . Untuk membuat direktori – direktori tersebut dapat dilakukan dengan command prompt, lakukan langkah – langkah berikut :
* Masuk ke command prompt, dengan cara Start > Run, ketikan CMD, kemudian ENTER.
* Ketikkan code dibawah ini :
C:squidsbinsquid.exe -z
* Tunggu sampai proses selesai.

6. Setelah itu tinggal proses integrasi antara squid dengan windows, yaitu dengan cara mendaftarkan program squid sebagai service, dengan cara :
* Masuk ke command prompt, dengan cara Start > Run, ketikan CMD, kemudian ENTER.
* Ketikkan code berikut :
C:squidsbinsquid.exe -i -n squid
* Setelah itu cek dan aktifkan service, dengan cara masuk ke Control Panel > Adminstrative Tools > Services
cari nama service squid. Setelah ketemu klik kanan dan pilih Start.

Tahap penginstallasian squid telah selesai, sekarang tinggal bagaimana mengintegrasikan service squid pada browser. Seperti yang saya singgung pada awal artikel ini, bahwa squid itu adalah sebuah sebuah daemon untuk mempercepat browser, dengan cara meload cache – cache yang tidak diperlukan dari komputer kita / localhost.
Jadi, hal yang ditegaskan disini adalah perubahan Proxy, dari default ke localhost dengan port 3128 .
Apabila pembaca belum mengetahui, bagaimana cara melakukan perubahan proxy, maka saya akan menjelaskannya sedikit.

Mengganti Proxy Pada Firefox :
▬ Klik Tools >> Options..
▬ Pilih Advanced, dan masuk ke tab Network
▬ Klik settings, dan Pilih manual proxy configuration,
Kemudian isi HTTP Proxy dengan : localhost | Untuk Port dengan : 3128

Mengganti Proxy Pada IE :
▬ Klik Tools > Internet Options > Connections
▬ Klik LAN Settings, kemudian pilih Use Proxy Server
▬ Isikan Address : localhost | Untuk Port dengan : 3128

Mengganti Proxy Pada Opera :
▬ Klik Tools->Preference->Advanced
▬ Pilih proxy server dan isikan :
HTTP dengan : localhost | Untuk Port dengan : 3128

Tidak ada komentar:

Posting Komentar