WGT
(usa Ubuntu)
Enviado em 23/05/2012 - 11:02h
Gostaria de pedir ajuda para resolver um problema na empresa com o Squid. Não tenho muito conhecimento de linux, e utilizo o linux apenas como proxy e controle de acesso a sites.
O problema é que usando o proxy para acessar qualquer site o navegar fica quase um minuto como se estivesse procurando o site e depois desse tempo começa a abrir o site, mas se navegar direto pelo roteador o site abre muito rapido, sem nenhuma espera começa a carregar o site gradativo.
Na rede tenho dois links de internet, um dedicado telefonica e outro virtua ligados a um roteador Linksys RV042 em LoadBalance.
Configuração do computador: Intel Pentium4 CPU 2.80GHz com 1GB de memoria Ram e 70GB de HD.
Configurei o Ubuntu Linux 11.10 kernel 3.0.0-19-generic-pae em i686.
Programas: Squid 2.7, Webmin 1.580, Sarg 2.3.1, Apache 2.2.20 e Iptables 1.4.10
Fiz o compartilhamento da seguinte forma:
#!/bin/sh
modprobe iptable_nat
iptables -t filter -F
iptables -t nat -F
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.0/24 -o eth0 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -m state --state ESTABLISHED,RELATED -i eth0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
echo 1 > /proc/sys/net/ipv4/ip_forward
O meu Squid.conf está assim:
# WELCOME TO SQUID 2.7.STABLE9
# ----------------------------
#
#Recommended minimum configuration:
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 192.168.0.0/24
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Only allow purge requests from localhost
http_access allow purge localhost
http_access deny purge
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
# REGRAS PERSONALIZADAS
acl sem_cache url_regex -i "/etc/squid/sem_cache"
no_cache deny sem_cache
acl listaBranca dstdom_regex "/etc/squid/listabranca"
http_access allow listaBranca
acl listaNegra dstdom_regex "/etc/squid/listanegra"
http_access deny listaNegra
acl permitidos dstdom_regex "/etc/squid/sites-permitidos"
http_access allow permitidos
acl ipsliberados src "/etc/squid/ips_liberados"
http_access allow ipsliberados
acl extensao urlpath_regex -i "/etc/squid/extensao"
acl downLiberado dstdom_regex "/etc/squid/downliberado"
http_access deny extensao !downLiberado
acl bloqueados dstdom_regex "/etc/squid/sites-bloqueados"
http_access deny bloqueados
acl p_almoco dstdom_regex "/etc/squid/p_almoco"
acl almoco time 12:30-13:20
http_access deny p_almoco !almoco
#Se passar por tudo libera o acesso
http_access allow localnet
http_access deny all
#Allow ICP queries from local networks only
icp_access allow localnet
icp_access deny all
# Squid normally listens to port 3128
http_port 3128 transparent
#We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 414 MB
maximum_object_size_in_memory 64 KB
cache_dir diskd /var/spool/squid 10240 16 256
minimum_object_size 4 KB
maximum_object_size 102400 KB
cache_swap_low 90
cache_swap_high 95
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
# logfile_rotate 0
#Suggested default:
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
# example line deb packages
#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600
refresh_pattern . 0 20% 4320
# Don't upgrade ShoutCast responses to HTTP
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
# Apache to signal ETag correctly on such responses
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
# TAG: extension_methods
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
#Default:
error_directory /usr/share/squid/errors/Portuguese
deny_info ERR_ACCESS_DENIED_virus listaNegra
deny_info ERR_ACCESS_DENIED_bloq bloqueados
deny_info ERR_ACCESS_DENIED_bloq p_almoco
deny_info ERR_ACCESS_DENIED_bloq almoco
deny_info ERR_ACCESS_DENIED_virus extensao
dns_nameservers 8.8.8.8 8.8.4.4
hosts_file /etc/hosts
coredump_dir /var/spool/squid
pipeline_prefetch on
Alguém já passou por esse problema e teria uma ajuda?
Obrigado.