Konfigurasi Squidku

on Selasa, 03 Mei 2011

Daripada lupa mending saya catat dimari saja :D.

Pertama-tama install dulu squidnya

sudo apt-get install squid

edit berkas squid.conf

sudo pluma /etc/squid/squid.conf

ini setingan squid milik saya :D



#################################
# HIGH PERFORMANCE SQUID 2.7
# Config date : 21 April 2010
#################################

# ACCESS CONTROLS
# ---------------
acl all src 0.0.0.0/0.0.0.0
acl our_networks src 192.168.0.0/24 192.168.1.0/24 10.8.0.0/32
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl manager proto cache_object
acl QUERY urlpath_regex cgi-bin \?
acl apache rep_header Server ^Apache
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 localhost
http_access allow our_networks
http_reply_access allow all
icp_access allow all
miss_access allow all
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny to_localhost
ident_lookup_access deny all
cache deny QUERY
http_access allow all
snmp_access allow all


# NETWORK OPTIONS
# ---------------
http_port 3128 transparent
icp_access allow all

# OPTIONS WHICH AFFECT THE CACHE SIZE
# -----------------------------------
cache_mem 8 MB
maximum_object_size_in_memory 32 KB
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
cache_dir aufs /var/spool/squid/ 4000 10 256
maximum_object_size 128000 KB
cache_swap_low 90
cache_swap_high 95
update_headers off

# LOGFILE PATHNAMES AND CACHE DIRECTORIES
# ---------------------------------------
#access_log /var/spool/squid/access.log
access_log none
cache_log /var/spool/squid/cache.log
#cache_log /dev/null
cache_store_log none
logfile_rotate 5
log_ip_on_direct off
log_icp_queries off
buffered_logs off
netdb_filename none
client_db off
#pid_filename /var/run/squid.pid

# OPTIONS FOR TUNING THE CACHE
# ----------------------------
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i \.(gif|png|jp?g|ico|bmp|tiff?)$ 10080 95% 43200 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i \.(rpm|cab|deb|exe|msi|msu|zip|tar|gz|tgz|rar|bin|7z|doc?|xls?|ppt?|pdf|nth|psd|sis)$ 10080 90% 43200 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i \.(avi|iso|wav|mid|mp?|mpeg|mov|3gp|wm?|swf|flv|x-flv|axd)$ 43200 95% 432000 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i \.(html|htm|css|js)$ 1440 75% 40320 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i \.index.(html|htm)$ 0 75% 10080 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 1440 90% 10080

quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 100
store_avg_object_size 13 KB

# HTTP OPTIONS
# ------------
server_http11 on
collapsed_forwarding on
vary_ignore_expire on

# ANONIMITY OPTIONS
# -----------------
header_access From deny all
header_access Server deny all
header_access Link deny all
header_access Via deny all
header_access X-Forwarded-For deny all

# TIMEOUTS
# --------
forward_timeout 8 minutes
connect_timeout 2 minutes
peer_connect_timeout 120 second
read_timeout 60 minutes
request_timeout 120 second
persistent_request_timeout 2 minutes
client_lifetime 2 day
half_closed_clients on
pconn_timeout 240 seconds
shutdown_lifetime 60 second


# ADMINISTRATIVE PARAMETERS
# -------------------------
cache_mgr geazzy
cache_effective_user proxy
cache_effective_group proxy
httpd_suppress_version_string on
visible_hostname localhost

# ADVANCED NETWORKING OPTIONS
# ---------------------------
max_filedescriptors 2048

# DNS OPTIONS
# -----------
check_hostnames off
dns_timeout 120 seconds
#DNS NAWALA
#dns_nameservers 202.155.0.10 202.155.0.15

#dns_nameservers 10.0.18.38 10.0.18.42
dns_nameservers 202.134.0.155 202.134.1.10
snmp_incoming_address 0.0.0.0
snmp_outgoing_address 255.255.255.255
udp_incoming_address 0.0.0.0
udp_outgoing_address 255.255.255.255
hosts_file /etc/hosts
ipcache_size 8192
ipcache_low 90
ipcache_high 95

# MISCELLANEOUS
# -------------
memory_pools off
forwarded_for off
reload_into_ims on
coredump_dir /var/spool/squid/
pipeline_prefetch on
offline_mode off
###### END CONFIGURATION ###########


Rubah owner tuk partisi squid
sudo chown -R proxy:proxy /var/spool/squid/

trus dicek dulu

sudo squid -k parse

kalo ga’ ada error mari kita lanjutkan...


Buat cache dengan mengetikkan

sudo squid -z


jalankan squid :D
kalo di ubuntu
sudo service squid start


kalo di debian
# /etc/init.d/squid start


Untuk ceck squid file
du -hs /var/spool/squid

Ranking: 5
Comments
0 Comments
 
© Geazzy Corner All Rights Reserved