zeramos
(usa Slackware)
Enviado em 25/07/2008 - 10:22h
Olá pessoal!
Instalei o squid recentemente em um servidor Slack 2.6.21.5-SMP, fiz minhas acls, black e white lists e tudo estava a 1000 maravilhas quando..... a navegação ficou hiper lenta.
Ai vendo um post na net, um colega dava uma dica, apagar o cache e os logs, bem .... mesmo achando isso uma alternativa radical resolvi fazer... net ficou turbinada.
No dia seguinte novamente no final da tarde(sempre este horário) a net novamente ficou lenta, fiz o mesmo procedimento e ela voltou a ficar rápida. Poxa mas deve haver alguma solução melhor para isso.
No final posto meu squid.conf com algumas linhas qeu me indicaram para resolver isso, mas não creio que esteja ajudando!
Ps: Caso haja alguma coisa que eu possa fazer nos meus .conf para melhorá-los gostaria de uam ajuda.
Abraço.
######################## squid.conf##############################
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
maximum_object_size_in_memory 64 KB
maximum_object_size 4096 KB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/log/squid/cache 5000 16 256
access_log /var/log/squid/logs/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl whitelist url_regex -i "/etc/squid/whitelist"
acl blacklist url_regex -i "/etc/squid/blacklist"
acl all src 0.0.0.0/0.0.0.0
acl mynet src 192.168.0.0/24
acl SERVERARQ src 192.168.0.20/255.255.255.255
acl ZERAMOS src 192.168.0.3/255.255.255.255
acl AP src 192.168.0.115/255.255.255.255
acl ROSANA src 192.168.0.14/255.255.255.255
acl SERVER src 192.168.0.10/255.255.255.255
acl ROSELI src 192.168.0.119/255.255.255.255
acl MARLY src 192.168.0.120/255.255.255.255
acl ANGELO src 192.168.0.123/255.255.255.255
acl MICHELLI src 192.168.0.13/255.255.255.255
acl BV src 192.168.0.118/255.255.255.255
acl PAOLA src 192.168.0.117/255.255.255.255
acl MARLENE src 192.168.0.112/255.255.255.255
acl TONINHO src 192.168.0.111/255.255.255.255
acl ROZZETO src 192.168.0.121/255.255.255.255
acl TANIA src 192.168.0.11/255.255.255.255
acl PAULO src 192.168.0.116/255.255.255.255
acl CONTABIL src 192.168.0.12/255.255.255.255
acl PECAS01 src 192.168.0.122/255.255.255.255
acl SONIC src 192.168.0.30/255.255.255.255
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
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 ZERAMOS
http_access allow PAULO
http_access allow SONIC
http_access deny SERVER
http_access deny blacklist !whitelist
http_access allow manager localhost
http_access allow AP
http_access allow MARLY
http_access allow ROSANA
http_access allow MICHELLI
http_access allow BV
http_access allow PAOLA
http_access allow MARLENE
http_access allow TONINHO
http_access allow ROZZETO
http_access allow TANIA
http_access allow CONTABIL
http_access allow SERVERARQ
http_access allow ROSELI
http_access allow ANGELO
http_access allow PECAS01
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny blacklist !whitelist
#http_access deny all
icp_access allow all
coredump_dir /var/log/squid/cache
###########################################################
#########################rc.local##########################
modprobe ip_nat_ftp
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
#iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
echo "1" >/proc/sys/net/ipv4/ip_forward
squid