با سلام خدمت دوستای گلم
این کانفیگ من برای 4MB پهنای باند و ۲۰۰ کاربر انجام دادم
هدفم از گذاشتن ای کانفیگم این بود که دوستان ببینن و نظر بدن تا به یه کانفیگ خوب تو Squid 3.1 برسیم




#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl localhost src ::1/128
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl to_localhost dst ::1/128

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

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
acl net src 10.10.10.20
acl net1 src 10.10.10.21
acl net2 src 10.10.10.22
acl net3 src 10.10.10.23
acl net4 src 10.10.10.24
acl net5 src 10.10.10.0/24
#acl hh urlpath_regex .exe
#http_access deny hh
http_access allow net
http_access allow net1
http_access allow net2
http_access allow net3
http_access allow net4
http_access allow net5
http_access deny all

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
#http_access allow localhost

# And finally deny all other access to this proxy

# Squid normally listens to port 3128
http_port 3128 transparent

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
########################## memroy-squid ###################################
cache_mem 4096 MB
# Uncomment and adjust the following to add a disk cache directory.
cache_dir aufs /var/spool/squid 1000 16 256
maximum_object_size_in_memory 64 KB
maximum_object_size 1024 KB
minimum_object_size 0 KB
cache_swap_high 95
cache_swap_low 90
quick_abort_min 32 KB
quick_abort_max 32 KB
quick_abort_pct 95 KB
#request_header_max_size 100 KB
cache_replacement_policy heap LFUDA
############################ squid access log #############################
access_log /var/log/squid/access.log
############################ Bandwith Squid ##############################
acl large url_regex -i \.arj?$ \.au?$ \.asf?$ \.aif?$ \.avi?$ \.bz2?$ \.bin?$ \.cab?$ \.exe?$ \.iso?$ \.msi?$ \.mp3?$ \.mpg?$ \.mpe?$ \.mpeg?$ \.mp2?$ \.mov?$ \.qt?$ \.raw?$ \.ram?$ \.ra?$ \.rar?$ \.rm?$ \.rpm?$ \.tar?$ \.tar.gz?$ \.tgz?$ \.wmv?$ \.wma?$ \.wav?$ \.zip?$ \.mmf?$ \.sis?$ \.midi?$ \.3gp?$ \.psf?$ \.dat?$ \.3gp?$ \.exe?$
acl file urlpath_regex -i \.doc$ \.docx$ \.xlsx$ \.xls$ \.xps$ \.zip$ \.pps$ \.pptx$ \.one$ \.csv$ \.ppt$ \.pdf$
acl h urlpath_regex -i \.*$
delay_pools 7
delay_class 1 1
delay_parameters 1 4096/4096
delay_access 1 allow large net
delay_access 1 deny all
delay_class 2 1
delay_parameters 2 8048/8048
delay_access 2 allow large net1
delay_access 2 deny all
delay_class 3 1
delay_parameters 3 12096/14096
delay_access 3 allow large net2
delay_access 3 deny all
delay_class 4 1
delay_parameters 4 14096/14096
delay_access 4 allow large net3
delay_access 4 deny all
delay_class 5 1
delay_parameters 5 16096/16096
delay_access 5 allow large net4
delay_access 5 deny all
delay_class 6 1
delay_parameters 6 4096/4096
delay_access 6 allow large net5
delay_access 6 deny all
delay_class 7 1
delay_parameters 7 20096/14096
delay_access 7 allow file net5
delay_access 7 deny all
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
# Refresh patterns (refresh-ims)
# Image files
refresh_pattern -i \.png$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.gif$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.jpg$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.jpeg$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.bmp$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.tif$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.tiff$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.ico$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
# Compressed files
refresh_pattern -i \.zip$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.rar$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.tar$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.gz$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.tgz$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.z$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.7z$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.arj$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.lha$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.lzh$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.iso$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
# Binary files
refresh_pattern -i \.exe$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.msi$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.cab$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.deb$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.rpm$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.bin$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.ver$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.dll$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.mar$ 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
# Multimedia files
refresh_pattern -i \.mp3$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.wav$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.mid$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.midi$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.ram$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.ra$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.mov$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.avi$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.wmv$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.mpg$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.mpeg$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.swf$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.flv$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.mp4$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
# Document files
refresh_pattern -i \.pdf$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.ps$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.doc$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.ppt$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.pps$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
# Heavy Cache
refresh_pattern -i download.windowsupdate.com/.* 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i download.microsoft.com/.* 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i symantecliveupdate.com/.* 10080 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
# HTML
refresh_pattern -i \.index.(html|htm)$ 0 40% 10080
refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 43200

# Default patterns
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320


cache_mgr aghil.malksh@gmail.com
visible_hostname vtsco.net




موضوعات مشابه: