This is SQUID 2.6 quick example configuration:

This is SQUID 2.6 quick example configuration:

# ============================================== #
# NETWORK OPTIONS
# ============================================== #
http_port 3128 transparent
icp_port 3130
snmp_port 3401
# ============================================== #
# OPTIONS WHICH AFFECT THE NEIGHBOUR SELECTION ALGORITHM
# ============================================== #
dead_peer_timeout 30 seconds
mcast_icp_query_timeout 10
log_icp_queries on
connect_timeout 2 minutes
peer_connect_timeout 30 seconds
request_timeout 30 seconds
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
# ============================================== #
# OPTIONS WHICH AFFECT THE CACHE SIZE
# ============================================== #
cache_mem 8 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
maximum_object_size_in_memory 8 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024
cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF
# =============================================== #
# LOGFILE PATHNAMES AND CACHE DIRECTORIES
# =============================================== #
cache_dir diskd /cache1 12600 29 256 Q1=64 Q2=72
cache_dir diskd /cache2 12600 29 256 Q1=64 Q2=72
cache_dir diskd /cache3 12600 29 256 Q1=64 Q2=72
cache_dir diskd /cache4 12600 29 256 Q1=64 Q2=72
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /dev/null
mime_table /usr/local/etc/squid/mime.conf
# =============================================== #
# HTTPD-ACCELERATOR OPTIONS
# =============================================== #
log_ip_on_direct on
dns_nameservers 202.134.0.155 202.134.1.10 203.130.209.242 202.134.2.5
# =============================================== #
# MISCELLANEOUS
# =============================================== #
logfile_rotate 7
digest_generation on
digest_bits_per_entry 10
digest_rebuild_period 30 minute
digest_rewrite_period 30 minute
digest_swapout_chunk_size 6000 bytes
client_persistent_connections on
server_persistent_connections on
pipeline_prefetch on
store_dir_select_algorithm round-robin
nonhierarchical_direct off
prefer_direct off
# =============================================== #
# ADMINISTRATIVE PARAMETERS
# =============================================== #
cache_mgr admin_waluh@dodol.net
cachemgr_passwd 123456 all
cache_effective_user nobody
cache_effective_group nobody
visible_hostname proxy.dodol.net
# =============================================== #
# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS
# ============================================== #
unlinkd_program /usr/local/libexec/squid/unlinkd
pinger_program /usr/local/libexec/squid/pinger
# ============================================== #
# ACCESS CONTROLS
# ============================================== #
acl all src 0/0
acl localnet src 192.168.1.0/24
acl localhost src 127.0.0.0/8
# ============================================== #
# ACL Different access
# ============================================== #
acl SSL_ports port 443 563
acl Safe_ports port 21 80 280 448 591 777 443 563 808 70 210 4190-65535
acl CONNECT method CONNECT
acl purgemethod method purge
acl snmp snmp_community snmpcomunity
acl manager proto cache_object
# ============================================== #
# BLOCKING CONTENTS
# ============================================== #
acl bad url_regex “/root/bad.acl”
# block microsoft windows update
acl mikocok urlpath_regex msdownload/update/v3-19990518/cabpool
http_access deny bad
http_access deny mikocok
# ============================================== #
# Access Denied
# ============================================== #
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
# ============================================== #
# Internet Access
# ============================================== #
http_access allow manager !localhost
http_access allow purgemethod localhost
http_access allow localnet
http_access deny all
# ============================================== #
# htttp access user
# SNMP - MRTG Setting
# ============================================== #
snmp_access allow snmp localhost
snmp_access deny all
# ============================================== #
# TRAFFIC SHAPPING
# ============================================== #
acl local url_regex -i 192.168.1.
acl slow url_regex -i “/root/limit.txt”
## Delay Pool
# -1/-1 >> no limits for local traffic.
delay_pools 2
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow local
delay_access 1 deny all
# Bandwidth 2,8 Mbps >> (((2,8*1024)*1024)/8) >> 367001.6 B/s
# Allocation: 367 KB/s >> network, 3 KB/s >> slow download
delay_class 2 2
delay_parameters 2 367000/367000 3000/367000
delay_access 2 allow slow
delay_access 2 deny all
# No download for file more than 700 MB size
reply_body_max_size 700000000 allow all
# No uploading more than 5 MB in size
request_body_max_size 5 MB
# =============================================== #
Example for bad.acl file (mentioned in sample configuration above) to block unwanted sites:
^http://www\.submit-it.*
^http://ads01.*
^http://www\.eads.*
^http://ads\.
^http://ad\.
^http://ads02\.
^http://adaver.*\.
^http://adforce\.
/images/[Aa][Dd]/
/reklame/
/[Bb]anners/
17tahun
miyabi
sex
\.3[Gg][Pp]$
You may edit that file whatever you want.

Example for limit.txt file for limiting download speed for certain type of file:
\.[Gg][Zz]$
\.[Rr][Pp][Mm]$
\.[Zz][Ii][Pp]$
\.[Rr][Aa][Rr]$
\.[Mm][Pp][Ee]$
\.[Qq][Tt]$
\.[Rr][Aa][Mm]$
\.[Ii][Ss][Oo]$
\.[Rr][Aa][Ww]$
\.[Ww][Aa[Vv]$
\.[Dd][Ee][Bb]$
\.[Cc][Aa][Bb]$
\.[Rr][Mm]$
\.[Mm][Pp]$
\.[Mm][Pp][Gg]$
\.[Mm][Pp][Ee][Gg]$
\.[Ww][Mm][Vv]$
\.[Ww][Mm][Aa]$
\.[Mm][Oo][Vv]$
\.[Aa][Vv][Ii]$
\.[Mm][Pp][Gg]$
\.[Mm][Pp][Ee][Gg]$
\.[Ee][Xx][Ee]$
\.[Mm][Pp]3$
\.[Mm][Pp]4$
\.[Vv][Qq][Ff]$
\.[Ee][Xx][Ee]$
\.[Tt][Aa][Rr].[Gg][Zz]$
\.[Bb][Zz]2$

Share this

Related Posts

Previous
Next Post »