====== Squid 3 - Debian 7 ======
root@gateway:~# apt-get install squid3
root@gateway:~# cd /etc/squid3/
root@gateway:/etc/squid3# cp -p squid.conf{,.dist}
root@gateway:/etc/squid3# cat squid.conf
# OPTIONS FOR AUTHENTICATION
# -----------------------------------------------------------------------------
# ACCESS CONTROLS
# -----------------------------------------------------------------------------
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl sub_a src 192.0.2.0/24
acl sub_b src 198.51.100.0/24
acl to_sub_a dst 192.0.2.0/24
acl to_sub_b dst 198.51.100.0/24
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's ######
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
###### REGRAS ######
http_access allow sub_a
http_access allow sub_b
http_access allow to_sub_a
http_access allow to_sub_b
http_access deny all
# NETWORK OPTIONS
# -----------------------------------------------------------------------------
http_port 3128
# MEMORY CACHE OPTIONS
# -----------------------------------------------------------------------------
#Default:
# cache_mem 256 MB
cache_mem 64 MB
# DISK CACHE OPTIONS
# -----------------------------------------------------------------------------
cache_dir ufs /var/spool/squid3 100 16 256
# OPTIONS FOR TROUBLESHOOTING
# -----------------------------------------------------------------------------
coredump_dir /var/spool/squid3
# OPTIONS FOR TUNING THE CACHE
# -----------------------------------------------------------------------------
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
# ADMINISTRATIVE PARAMETERS
# -----------------------------------------------------------------------------
visible_hostname proxy.exemplo.org
# ERROR PAGE OPTIONS
# -----------------------------------------------------------------------------
error_default_language pt-br
root@gateway:/etc/squid3# squid3 -k reconfigure
root@gateway:/etc/squid3# service squid3 stop
[ ok ] Stopping Squid HTTP Proxy 3.x: squid3.
root@gateway:/etc/squid3# squid3 -z
2016/07/14 18:07:39| Creating Swap Directories
2016/07/14 18:07:39| /var/spool/squid3 exists
2016/07/14 18:07:39| Making directories in /var/spool/squid3/00
2016/07/14 18:07:40| Making directories in /var/spool/squid3/01
2016/07/14 18:07:40| Making directories in /var/spool/squid3/02
2016/07/14 18:07:40| Making directories in /var/spool/squid3/03
2016/07/14 18:07:40| Making directories in /var/spool/squid3/04
2016/07/14 18:07:40| Making directories in /var/spool/squid3/05
2016/07/14 18:07:40| Making directories in /var/spool/squid3/06
2016/07/14 18:07:40| Making directories in /var/spool/squid3/07
2016/07/14 18:07:40| Making directories in /var/spool/squid3/08
2016/07/14 18:07:40| Making directories in /var/spool/squid3/09
2016/07/14 18:07:40| Making directories in /var/spool/squid3/0A
2016/07/14 18:07:40| Making directories in /var/spool/squid3/0B
2016/07/14 18:07:40| Making directories in /var/spool/squid3/0C
2016/07/14 18:07:40| Making directories in /var/spool/squid3/0D
2016/07/14 18:07:40| Making directories in /var/spool/squid3/0E
2016/07/14 18:07:40| Making directories in /var/spool/squid3/0F
root@gateway:/etc/squid3# service squid3 start
[ ok ] Starting Squid HTTP Proxy 3.x: squid3.