juniorbiu
(usa Debian)
Enviado em 19/11/2013 - 14:52h
Companheiros, boa noite.
Na empresa onde trabalho montei um proxy baseado em CentOS + Squid com a seguinte configuração:
> Distro: CentOS
> Versão: Linux 2.6.32-358.18.1.el6.x86_64
> Squid: Version 3.1.10
> SquidGuard: 1.3 Berkeley DB 4.7.25
> Servidor com 5GB de RAM / 4 Proc / Vmware ESXi 5.1
* /var/cache com 35GB exclusivo
Com base nestas infos, configurei o squid.conf a seguir.
O que acredito é que possa melhorar, ainda não esta refinadinho. E por isso recorro aos senhores.
O que pode ser melhorado?
******************************************************
******************************************************
http_port 10.152.166.21:8080
hierarchy_stoplist cgi-bin ?
visible_hostname proxy.xx
# Memoria cache
cache_mem 2048 MB
memory_pools off
#Tamanho maximo de arquivos alocados na RAM
maximum_object_size_in_memory 512 KB
memory_replacement_policy heap GDSF
quick_abort_min -1 KB
# Maximo e Minimo armazenados em disco
maximum_object_size 512 MB
minimum_object_size 0 KB
# Porcentagem de atualizacao do cache - limpo ao atingir o maximo
cache_replacement_policy heap LFUDA
cache_swap_low 80
cache_swap_high 90
ipcache_size 1024
ipcache_low 80
ipcache_high 90
fqdncache_size 1024
# Download e Upload
client_request_buffer_max_size 512 KB
reply_body_max_size 100 MB
# Sites Corporativos
acl local_websites dst_as 10.0.0.0/255.0.0.0
http_access allow local_websites
acl manager proto cache_object
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
# 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
# ---- Cache do Windows Update ----
refresh_pattern windowsupdate.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
refresh_pattern download.microsoft.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
refresh_pattern
www.microsoft.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
refresh_pattern au.download.windowsupdate.com/.*\.(cab|exe|dll|msi) 4320 100% 43200 reload-into-ims
# Configuracoes de cache, dono, logs, errors
cache_effective_group squid
cache_dir aufs /var/cache/squid/cache/1 10000 10 128
cache_dir aufs /var/cache/squid/cache/2 10000 10 128
cache_dir aufs /var/cache/squid/cache/3 10000 10 128
cache_dir aufs /var/cache/squid/cache/4 10000 10 128
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
error_directory /usr/share/squid/errors/pt-br/
cache_mgr xxxx@xxxx.com
# Atualizacoes do cache
hierarchy_stoplist cgi-bin ?
hierarchy_stoplist html ?
refresh_pattern -i \.jpg$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.gif$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.png$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.jpeg$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.bmp$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.tif$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.tiff$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.swf$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.exe$ 0 50% 21600 reload-into-ims
refresh_pattern -i \.php$ 0 20% 1440 reload-into-ims
refresh_pattern -i \.html$ 0 20% 1440 reload-into-ims
refresh_pattern -i \.htm$ 0 20% 1440 reload-into-ims
refresh_pattern -i \.shtml$ 0 20% 1440 reload-into-ims
refresh_pattern -i \.shtm$ 0 20% 1440 reload-into-ims
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
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
################################################
## SQUIDGUARD ##
################################################
redirect_program /usr/bin/squidguard -c /etc/squid/squidguard.conf
#Numero de processos do squidguard
redirect_children 20
#Mantem o Squid funcionando quando o Squidguard pare
redirector_bypass on
##############################################
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# 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 SQSTAT
acl manager proto cache_object
acl webserver src 10.152.166.21/255.255.255.0
http_access allow manager webserver
http_access deny manager
half_closed_clients off
server_persistent_connections off
client_persistent_connections off
http_access deny manager
http_access allow localnet
http_access allow localhost
http_access deny all
******************************************************
******************************************************