วันพฤหัสบดี, ธันวาคม 22, 2548

How-to Squid


http_port 8080 จะให้ใช้พอรท์ไหน (ในที่นี้คือ 8080 )
#cache_mem 8 MB ถ้าใครมีเครื่อง client มากกว่า 20-30 ขึ้นไปแล้ว h/d ทำงานหนักให้เปิดใช้ครับ
#cache_peer xxxxxx parent xxx 3130 no-query ถ้าใช้เน็ตของ isp อะไรก็แล้วแต่แล้วมี proxy ให้เปิดใช้ + พร้อมใส่ค่า proxy ลงไป (cache_peer พอกซี่ parent พอรท์ 3130 no-query)
hierarchy_stoplist cgi-bin ? .pl .cgi .php .php3 .php4 .shtml
acl QUERY urlpath_regex cgi-bin \? .pl .cgi .php .php3 .php4 .shtml
no_cache deny QUERY
cache_dir ufs C:/squid/cache 512 24 256 cache ต้องมากหน่อยเพราะใช้พื้นที่ในการเก็บค่อนข้างเยอะไม่งั้นเต็มเร็ว (ขนาดนี้ก็เยอะแระ) หรือจะเพิ่มอีกก็ได้แต่ต้องไม่เกิน 80 % ของไดร์นั้น
cache_access_log none
cache_store_log none
cache_log none
pid_filename none
refresh_pattern -i \.art$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.crw$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.djvu$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ttf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.fpx$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.icn$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ico$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.icl$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.kdc$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mag$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.sif$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aifc$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aiff$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.asf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.au$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.avi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.m1v$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mid$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.midi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp2$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp2v$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp3$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpa$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpe$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpeg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpv2$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.rmi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.snd$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wav$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wma$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wmv$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.sid$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pcd$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pic$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pict$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pix$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pbm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pgm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ppm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.eps$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.psp$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xbm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xpm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.bmp$ 525960 80% 525960 reload-into-ims พวกนี้คือหัวใจของความเรงเลยครับ ไม่ต้องเพิ่มไรแล้วครับที่ครบสูตรแล้วครับ
refresh_pattern -i \.jpeg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pcx$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.png$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.tga$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.tiff$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.gif$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wmf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.emf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pic$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.iff$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.psd$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ras$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.rs$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.sgi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.swf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pdf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.exe$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.zip$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.rar$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mov$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.cda$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp1$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aac$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.nsa$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ogg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.kar$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.miz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mod$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mdz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.nst$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.stm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.stz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.s3m$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.s3z$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.it$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.itz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xmz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mtm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ult$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.669$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.far$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.amf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.okt$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ptm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.voc$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aif$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.m2v$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.nsv$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.m3u$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pls$ 525960 80% 525960 reload-into-ims
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl keyword url_regex -i sex บล๊อคคำหรือเวปที่มีความหมายเกี่ยวกับคำๆนั้น (รูปแบบ sex xxx musicstation ที่ไม่ใส่เยอะเพราะกลัวเข้าบางเวปไม่ได้)
http_access deny keyword
acl download urlpath_regex -i \.mp3$ บล๊อคไฟล์ที่ห้าม d/l (รูปแบบ \.exe$ \.zip$ \.rar$ \.mp3$ ที่ใส่แค่ .mp3 เพราะว่ามีบางเกมส์ online ยังต้อง d/l .zip .exe อยู่กลัวมีปัญหา)
http_access deny download
acl all src 0.0.0.0/0.0.0.0
acl localnet src 192.168.0.0/255.255.255.0 ท่าเครื่องใช้ไอพีคราส 192.168.0.1 ก็ให้ใช้ค่านี้ถ้าใครใช้ค่าอื่นนอกเหนือจากนี้ให้เปลี่ยนด้วย (รูปแบบ 192.168.1.0)
acl localhost src 127.0.0.1/255.255.255.255
acl manager proto cache_object
acl Safe_ports port 21 80 443 563 70 210 280 488 591 777 1025-65535
acl CONNECT method CONNECT
http_access allow localnet
http_access allow localhost
http_access deny !Safe_ports
http_access deny CONNECT
http_access deny all
cache_mgr Adminstrator
cache_effective_user squid
cache_effective_group squid
visible_hostname Siamcafe.net
ie_refresh on
#delay_pools 1
#delay_class 1 1
#delay_access 1 allow localnet
#delay_parameters 1 20000/20000 ถ้าใครอยากจำกัด b/w เครื่อง client ก็ให้เปิดใช้ delay ทุกตัว (ความเร็วที่เปิดให้ client 200 kbps)


ISP Proxy ต่างๆ

cache_peer proxy.infonews.co.th parent 8080 3130 no-query INFONEWS (INFOACCESS)
cache_peer proxy.wnet.net.th parent 8080 3130 no-query WORLDNET (APRICOT)
cache_peer proxy.sgn.net.th parent 8080 3130 no-query SIAM GLOBAL ACCESS
cache_peer proxy.linethai.co.th parent 8080 3130 no-query DATA-LINETHAI
cache_peer proxy.asiaaccess.net.th parent 8080 3130 no-query ASIACCESS
cache_peer proxy.cwn.net.th parent 8080 3130 no-query CWN-INTERNET
cache_peer proxy.asianet.co.th parent 8080 3130 no-query ASIANET
cache_peer proxy.loxinfo.co.th parent 8080 3130 no-query LOXINFO
cache_peer proxy.samart.co.th parent 8080 3130 no-query SAMART
cache_peer proxy.pacific.net.th parent 8080 3130 no-query PACIFIC
cache_peer proxy.roynet.co.th parent 8080 3130 no-query ROYNET
cache_peer proxy.siamit.co.th parent 8080 3130 no-query SIAM-IT
cache_peer netproxy1.inet.co.th parent 8080 3130 no-query I-NET
cache_peer proxy.idn.co.th parent 8080 3130 no-query IDIA-NET
cache_peer proxy.anet.net.th parent 8080 3130 no-query A-NET
cache_peer proxy.ji-net.com parent 8080 3130 no-query JI-NET
cache_peer proxy.sga.net.th parent 8080 3130 no-query E-GO
cache_peer proxy.cscoms.com parent 8080 3130 no-query CS
cache_peer proxy.ksc.net.th parent 8080 3130 no-query KSC

credit:

http://phst.ph.mahidol.ac.th/Linux/html/squid.html

http://www.itwizard.info/technology/linux/squid_install_and_config.html

http://micro.se-ed.com/content/mc205/MC205_181.asp

http://www.squid-cache.org/Doc/FAQ/FAQ-11.html#ss11.44


http://www.siamcafe.net/board/index.php?topic=9285.0

ไม่มีความคิดเห็น: