Mempercapat SMART dengan Squid Windows
Written on Kamis, Mei 06, 2010 by Akalana Studio
Berhubung koneksi yang satu ini banyak yang memakai, namun tidak ultimited hanya terbatasi dengan 2GB saja perbulan dan free selama 6 bulan alias 12GB. Mantap kan bro dengan harga 333ribu ini kita bisa internetan 24Jam, Hebatnya lagi di malam hari antara pukul 00.00 -08.00 dg kecepatan download 24KB bila beruntung, we keke.
Biar lebih beruntung lagi, mari kita buatkan squid buat komputer kita, alias hemat BBM, opo maneh .. kurang murah nich.. Menurut catatan yang di copy “untuk menghemat kouta bandwith dan meningkatkan kecepatan kita perlu gunakan cache proxy. Kenapa harus chace proxy ? Kenapa menggunakan cache proxy ? Dengan cache proxy, pada situs-situs yang sering kita kunjungi, content yang harus didownload dan mengurangi jatah quota kita akan lebih sedikit. Karena content-content tersebut akan tersimpan dahulu di cache proxy kita. Jadi secara tidak langsung, jika kita mengunjungi situs tersebut berulang kali, sama saja kita mendownload content dari komputer yang terinstall proxy kita. Kesimpulannya.. lebih cepat dan lebih ngirit bandwidth” oke,, mudeng ga?
Pertama kita siapkan koneksi kita, dalam hal ini kita pakek SMAT, namun tidak menutup kemungkinan yang lain juga bisa dong. Download saja squid untuk windows disni dan saatnya kita bermain-main dengan squid kita.. Banyak opsi yang bisa kita gunakan seperti pada tulisan yang dulu pernah dibahas squid di LINUX, namun dalam hal ini kita hanya akan memanfaatkan cache untuk 2GB kita biar ngirit dari pada mubazir akibat kita sering buka situs yang sama di hari yang sama, di minggu yang sama. Ugh,, loading lama lagi. Dengan squid dijamin tidak akan lama dengan syarat SMART dalam keadaan baik, tidak Request timed out dan ada sinyal tentunya bro.
Setelah kita download extras tuh squid di C:/ terus kita optimilisasi dengan cara :
1. Masuk ke C:/squid/etc hampir mirip di linux ada etc nya ..
* cachemgr.conf.default
* mime.conf.default
* squid.conf.default
* squid_radius_auth.conf.default
Dirubah menjadi
* cachemgr.conf
* mime.conf
* squid.conf
* squid_radius_auth.conf
Oke, cukup mudah kan, dan ga harus belajar linux, ato apa kek, cuma tinggal rename aja.
2. Editlah squid.conf dengan script sebagai berikut ini
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
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access allow all
http_port 3128
hierarchy_stoplist cgi-bin ?
cache_mem 94 MB
cache_dir ufs c:/squid/var/cache 512 16 256
minimum_object_size 0 KB
maximum_object_size 4096 KB
access_log c:/squid/var/logs/access.log squid
cache_log c:/squid/var/logs/cache.log
cache_store_log c:/squid/var/logs/store.log
ftp_passive off
acl QUERY urlpath_regex cgi-bin ?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
visible_hostname localhost
dns_nameservers 202.70.61.61 202.43.178.245
coredump_dir c:/squid/var/cache
Gimana, gampang kan,, Scrpit asli dari squid.conf bisa di backup dulu, terus diganti isinya dengan script diatas. cache_mem 94 MB disesuaikan aja dengan 1/4 RAM kamu.
3. Jalan kan opsi berikut ini didalam direktori C:/squid/sbin
C:squidsbin>squid -z
2009/04/10 08:45:20| Creating Swap Directories
C:squidsbin>squid -d l -D
2008/04/10 08:46:17| Starting Squid Cache version 2.7.STABLE5 for i686-pc-winnt.
2008/04/10 08:46:17| Running on Windows XP
Hentikan dengan ctrl+ZX
C:squidsbin>squid -i
Registry stored HKLMSOFTWAREGNUSquid2.6SquidConfigFile value c:/squid/etc/
squid.conf
Squid Cache version 2.7.STABLE5 for i686-pc-winnt
installed successfully as Squid Windows System Service.
To run, start it from the Services Applet of Control Panel.Don’t forget to edit squid.conf before starting it.
C:squidsbin>squid -O -D
Registry stored HKLMSOFTWAREGNUSquid2.6SquidCommandLine value -D
Sampai disini kita sudah selesai , dan lihatlah cache.log pada C:/squid/var/cace.log
Bedanya disini untuk melihatnya bukan perintah tail -f , namun tinggal dibuka pekek notepad aja.
2009/04/10 00:45:44| logfileClose: closing log c:/squid/var/logs/store.log
2009/04/10 00:45:44| logfileClose: closing log c:/squid/var/logs/access.log
2009/04/10 00:45:44| Squid Cache (Version 2.7.STABLE6): Exiting normally.
2009/04/10 00:47:08| Starting Squid Cache version 2.7.STABLE6 for i686-pc-winnt…
2009/04/10 00:47:08| Running as Squid Windows System Service on Windows XP
2009/04/10 00:47:08| Service command line is: -D
2009/04/10 00:47:08| Process ID 1520
2009/04/10 00:47:08| With 2048 file descriptors available
2009/04/10 00:47:08| With 2048 CRT stdio descriptors available
2009/04/10 00:47:08| Windows sockets initialized
2009/04/10 00:47:08| Using select for the IO loop
2009/04/10 00:47:08| DNS Socket created at 0.0.0.0, port 3422, FD 5
2009/04/10 00:47:08| Adding nameserver 202.70.61.61 from squid.conf
2009/04/10 00:47:08| Adding nameserver 202.43.178.245 from squid.conf
2009/04/10 00:47:08| User-Agent logging is disabled.
2009/04/10 00:47:08| Referer logging is disabled.
2009/04/10 00:47:08| logfileOpen: opening log c:/squid/var/logs/access.log
2009/04/10 00:47:08| Unlinkd pipe opened on FD 8
2009/04/10 00:47:08| Swap maxSize 524288 + 96256 KB, estimated 0 objects
2009/04/10 00:47:08| Target number of buckets: 2386
2009/04/10 00:47:08| Using 8192 Store buckets
2009/04/10 00:47:08| Max Mem size: 96256 KB
2009/04/10 00:47:08| Max Swap size: 524288 KB
2009/04/10 00:47:08| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2009/04/10 00:47:08| logfileOpen: opening log c:/squid/var/logs/store.log
2009/04/10 00:47:08| Rebuilding storage in c:/squid/var/cache (CLEAN)
2009/04/10 00:47:08| Using Least Load store dir selection
2009/04/10 00:47:08| Set Current Directory to c:/squid/var/cache
2009/04/10 00:47:08| Loaded Icons.
2009/04/10 00:47:08| Accepting proxy HTTP connections at 0.0.0.0, port 3128, FD 14.
2009/04/10 00:47:08| Accepting ICP messages at 0.0.0.0, port 3130, FD 15.
2009/04/10 00:47:08| Accepting HTCP messages on port 4827, FD 16.
2009/04/10 00:47:08| Accepting SNMP messages on port 3401, FD 17.
2009/04/10 00:47:08| Ready to serve requests.
2009/04/10 00:47:08| Done reading c:/squid/var/cache swaplog (0 entries)
2009/04/10 00:47:08| Finished rebuilding storage from disk.
2009/04/10 00:47:08| 0 Entries scanned
2009/04/10 00:47:08| 0 Invalid entries.
2009/04/10 00:47:08| 0 With invalid flags.
2009/04/10 00:47:08| 0 Objects loaded.
2009/04/10 00:47:08| 0 Objects expired.
2009/04/10 00:47:08| 0 Objects cancelled.
2009/04/10 00:47:08| 0 Duplicate URLs purged.
2009/04/10 00:47:08| 0 Swapfile clashes avoided.
2009/04/10 00:47:08| Took 0.1 seconds ( 0.0 objects/sec).
2009/04/10 00:47:08| Beginning Validation Procedure
2009/04/10 00:47:08| Completed Validation Procedure
2009/04/10 00:47:08| Validated 0 Entries
2009/04/10 00:47:08| store_swap_size = 0k
2009/04/10 00:47:09| storeLateRelease: released 0 objects
Selamat deh, kamu sudah berhasil membuat squid di Windows.
4. Lakukan perubahan option proxy pada browser kita, karena squid ini tidak transparan bro .. oke
Tols-Options-Advanced-Networks-Setting-Manual Setting Proxy
Disi dengan 127.0.0.1 dengan prot 3128 yang lainya di biarkan saja.
5. Untuk menjalankan proxy, masuk ke “Control Panel” -> “Administrative Tools” -> “Services“. Kemudian cari nama services “squid” -> “Klik kanan” -> “Start“.
6. Cek di C:/squid/var/log/access.log
1239301675.546 4609 127.0.0.1 TCP_MISS/200 949 POST http://www.facebook.com/ajax/chat/buddy_list.php – DIRECT/69.63.176.140 application/x-javascript
1239301696.343 57093 127.0.0.1 TCP_MISS/200 395 GET http://0.channel04.facebook.com/x/939578876/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
1239301696.578 3250 127.0.0.1 TCP_MISS/200 1106 POST http://www.facebook.com/ajax/chat/buddy_list.php – DIRECT/69.63.176.140 application/x-javascript
1239301702.203 57344 127.0.0.1 TCP_MISS/200 395 GET http://1.channel04.facebook.com/x/494772851/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
1239301706.140 2140 127.0.0.1 TCP_MISS/200 1872 GET http://static.cache.l.google.com/safebrowsing/rd/goog-phish-shavar_a_51411-51415.51411-51415.: – DIRECT/74.125.96.86 application/vnd.google.safebrowsing-chunk
1239301732.250 4375 127.0.0.1 TCP_MISS/200 677 POST http://blog.uad.ac.id/lukman/wp-admin/admin-ajax.php – DIRECT/118.97.8.24 text/xml
1239301755.000 58547 127.0.0.1 TCP_MISS/200 395 GET http://0.channel04.facebook.com/x/331827029/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
1239301759.359 57047 127.0.0.1 TCP_MISS/200 395 GET http://1.channel04.facebook.com/x/1833969791/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
1239301780.140 2875 127.0.0.1 TCP_MISS/200 979 GET http://blog.uad.ac.id/lukman/wp-includes/js/thickbox/tb-close.png – DIRECT/118.97.8.24 image/png
1239301780.781 3516 127.0.0.1 TCP_MISS/200 3640 GET http://blog.uad.ac.id/lukman/wp-admin/media-upload.php? – DIRECT/118.97.8.24 text/html
1239301782.625 2735 127.0.0.1 TCP_MISS/200 2322 GET http://blog.uad.ac.id/lukman/wp-admin/css/media.css? – DIRECT/118.97.8.24 text/css
1239301784.578 1875 127.0.0.1 TCP_MISS/200 1593 GET http://blog.uad.ac.id/lukman/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php? – DIRECT/118.97.8.24 text/javascript
1239301792.359 7375 127.0.0.1 TCP_MISS/200 9802 GET http://blog.uad.ac.id/lukman/wp-includes/js/swfupload/swfupload.js? – DIRECT/118.97.8.24 text/css
1239301810.359 17969 127.0.0.1 TCP_MISS/200 5209 GET http://blog.uad.ac.id/lukman/wp-includes/js/swfupload/plugins/swfupload.swfobject.js? – DIRECT/118.97.8.24 text/css
1239301810.406 22360 127.0.0.1 TCP_MISS/200 677 POST http://blog.uad.ac.id/lukman/wp-admin/admin-ajax.php – DIRECT/118.97.8.24 text/xml
1239301810.734 22563 127.0.0.1 TCP_MISS/200 1541 POST http://www.facebook.com/ajax/reqs.php – DIRECT/69.63.180.14 application/x-javascript
1239301812.156 57063 127.0.0.1 TCP_MISS/200 395 GET http://0.channel04.facebook.com/x/4281899396/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
1239301812.984 2594 127.0.0.1 TCP_MISS/200 530 GET http://blog.uad.ac.id/lukman/wp-includes/js/swfupload/plugins/swfupload.queue.js? – DIRECT/118.97.8.24 text/css
1239301815.421 4546 127.0.0.1 TCP_MISS/200 1402 GET http://b.static.ak.fbcdn.net/images/icons/wall_post.gif – DIRECT/125.56.199.91 image/gif
1239301816.062 5250 127.0.0.1 TCP_MISS/200 676 GET http://b.static.ak.fbcdn.net/images/icons/friend_suggestion.gif – DIRECT/125.56.199.91 image/gif
1239301816.578 57094 127.0.0.1 TCP_MISS/200 395 GET http://1.channel04.facebook.com/x/3924218433/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
1239301852.890 4687 127.0.0.1 TCP_MISS/200 697 POST http://blog.uad.ac.id/lukman/wp-admin/admin-ajax.php – DIRECT/118.97.8.24 text/xml
1239301872.812 59703 127.0.0.1 TCP_MISS/200 395 GET http://0.channel04.facebook.com/x/171220624/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
1239301876.218 59531 127.0.0.1 TCP_MISS/200 395 GET http://1.channel04.facebook.com/x/2948167992/false/p_1248733445=0 – DIRECT/69.63.176.164 text/plain
Selamat Proxy kita sudah jalan. . untuk melihat cache yang tersmipan ada di C:squidvarcache. disitulah lokasi cache kita berada.
Kita juga bisa agar cache.log tidak bertambah banyak ukuranya, alias merekam aktifitas kita berinternet, tinggal di matikan saja di squid.conf cari kata ini “access_log c:/squid/var/logs/access.log squid” terus rubahlah menjadi “access_log none” tanpa tada petik.
Semoga bermanfaat.