Senin, 10 Desember 2007

Tuning Squid

Berikut adalah squid.conf nya
###—–start of squid.conf——####
http_port 8080
# jika squid nya 2.6 keatas, untuk transparent proxy gunakan :
# http_port 192.168.2.1:8080 transparent
hierarchy_stoplist cgi-bin ?
#We recommend you to use the following two lines.
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

cache_mem 8 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 128 MB
minimum_object_size 0 KB

maximum_object_size_in_memory 16 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
cache_dir ufs /usr/local/squid/cache 4000 16 256
access_log /usr/local/squid/logs/access.log squid
cache_log /usr/local/squid/logs/cache.log
hosts_file /etc/hosts
# cache_store_log none
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

refresh_pattern /.gif 4320 50% 43200
refresh_pattern /.jpg 4320 50% 43200
refresh_pattern /.jpeg 4320 50% 43200
refresh_pattern /.png 4320 50% 43200
refresh_pattern ^http://www.friendster.com/.* 720 100% 10080
refresh_pattern ^http://mail.yahoo.com/.* 720 100% 10080
refresh_pattern ^http://*.yahoo.*/.* 720 100% 7200
refresh_pattern ^http://*.google.com/.* 720 100% 10080
refresh_pattern ^http://www.telkomspeedy.com/.* 720 100% 28800
refresh_pattern ^http://*.blogsome.com/.* 720 80% 10080
refresh_pattern ^http://*.wordpress.com/.* 720 80% 10080
refresh_pattern ^http://detik.com/.* 720 90% 2880

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

negative_ttl 2 minutes
#Recommended minimum configuration:
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
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 CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports

acl sex url_regex -i “/usr/local/squid/sex”
acl notsex url_regex -i “/usr/local/squid/notsex”
acl smansa src 192.168.2.0/24
acl tdkbebasdonlot time 08:00-12:00
acl magic_word url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .tar.bz2 .bz2 .rp
#http_access allow smansa
http_access allow notsex all
http_access deny sex all
http_access allow smansa
http_access deny all

http_reply_access allow all
icp_access allow all

reply_body_max_size 4048000 allow magic_word tdkbebasdonlot

cache_mgr mas@bimo.web.id
visible_hostname security-network-admin-smansa
offline_mode on
# jika squid nya 2.6 keatas, untuk transparent proxy 4 baris di bawah ini tidak di
# pakai ( lihat baris #2 paling atas ):
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on


coredump_dir /usr/local/squid/cache
###—–End of squid.conf——–####

Tidak ada komentar: