Squid não geral log

1. Squid não geral log

Marcos Aurelio de Souza
marcos.ti

(usa Red Hat)

Enviado em 27/12/2011 - 10:11h

Bom dia!
Estou utilizando o squid, porem ele não gera o log corretamente, ele so gera o log do servidor, das maquinas da rede não aparece...Ex.: so aparece o ip 114.0.0.0, e faço acesso de outras e não vai para o log. agradeço se poderem me ajudar.


  


2. Re: Squid não geral log

Marcelo Miranda
rugal_bernstein

(usa Ubuntu)

Enviado em 27/12/2011 - 14:25h

Como você instalou o squid? Com yum? Compilou o pacote? Pode ser um erro numa biblioteca ou algo errado no syslog, eu te recomendaria reinstalar. Se fez com o yum baixe o pacote e compile, caso tenha compilado, uso o yum.


3. direto no sistema

Marcos Aurelio de Souza
marcos.ti

(usa Red Hat)

Enviado em 27/12/2011 - 14:41h

quando instalei o Redhat selecionei o pacote...foi na instalaçao do sistema...


4. Re: Squid não geral log

Reginaldo de Matias
saitam

(usa Slackware)

Enviado em 27/12/2011 - 14:46h

poste o resultado do comando abaixo que indica o local que foi instalado o squid.
whereis squid

verifique também
tail -f /var/log/squid/access.log




5. relatorio dos comandos

Marcos Aurelio de Souza
marcos.ti

(usa Red Hat)

Enviado em 27/12/2011 - 15:01h

primeiro passo

[root@localhost bin]# whereis squid
squid: /usr/sbin/squid /etc/squid /usr/lib/squid /usr/share/squid /usr/share/man/man8/squid.8.gz

segundo passo

[root@localhost bin]# tail -f /var/log/squid/access.log
1325004012.130 1262 114.0.0.0 TCP_MISS/200 336 POST http://64.4.44.30/gateway/gateway.dll? - DIRECT/64.4.44.30 application/x-msn-messenger
1325004012.691 7150 114.0.0.0 TCP_MISS/200 896 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004016.278 917 114.0.0.0 TCP_MISS/200 2233 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004016.703 424 114.0.0.0 TCP_MISS/200 338 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004022.061 1210 114.0.0.0 TCP_MISS/200 335 POST http://64.4.44.30/gateway/gateway.dll? - DIRECT/64.4.44.30 application/x-msn-messenger
1325004032.254 653 114.0.0.0 TCP_MISS/200 335 POST http://64.4.44.30/gateway/gateway.dll? - DIRECT/64.4.44.30 application/x-msn-messenger
1325004032.817 63385 114.0.0.0 TCP_MISS/200 4523 CONNECT plusone.google.com:443 - DIRECT/74.125.234.77 -
1325004032.870 61910 114.0.0.0 TCP_MISS/200 8119 CONNECT ssl.gstatic.com:443 - DIRECT/74.125.234.95 -
1325004036.006 571 114.0.0.0 TCP_MISS/200 824 GET http://rad.msn.com/ADSAdClient31.dll? - DIRECT/65.55.121.231 text/html
1325004036.647 641 114.0.0.0 TCP_MISS/200 337 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004041.927 896 114.0.0.0 TCP_MISS/200 335 POST http://64.4.44.30/gateway/gateway.dll? - DIRECT/64.4.44.30 application/x-msn-messenger
1325004051.911 730 114.0.0.0 TCP_MISS/200 336 POST http://64.4.44.30/gateway/gateway.dll? - DIRECT/64.4.44.30 application/x-msn-messenger
1325004055.621 42190 114.0.0.0 TCP_MISS/200 815 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004056.295 674 114.0.0.0 TCP_MISS/200 815 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004056.512 458 114.0.0.0 TCP_MISS/200 893 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004057.206 904 114.0.0.0 TCP_MISS/200 815 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004057.248 548 114.0.0.0 TCP_MISS/200 617 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004057.817 569 114.0.0.0 TCP_MISS/200 337 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004061.899 721 114.0.0.0 TCP_MISS/200 427 POST http://64.4.44.30/gateway/gateway.dll? - DIRECT/64.4.44.30 application/x-msn-messenger
1325004077.672 603 114.0.0.0 TCP_MISS/200 338 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004098.118 1481 114.0.0.0 TCP_MISS/200 338 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004111.486 54078 114.0.0.0 TCP_MISS/200 811 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004112.164 678 114.0.0.0 TCP_MISS/200 810 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004117.629 1034 114.0.0.0 TCP_MISS/200 1118 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004118.127 498 114.0.0.0 TCP_MISS/200 338 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004138.025 740 114.0.0.0 TCP_MISS/200 337 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004143.949 31784 114.0.0.0 TCP_MISS/200 897 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004156.739 581 114.0.0.0 TCP_MISS/200 7664 GET http://www.vivaolinux.com.br/comunidades/formPost.php? - DIRECT/174.123.53.162 text/html
1325004157.950 791 114.0.0.0 TCP_MISS/200 695 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004157.971 0 114.0.0.0 TCP_NEGATIVE_HIT/404 548 GET http://img.vivaolinux.com.br/include/syntax/styles/shCore.js - NONE/- text/html
1325004158.400 580 114.0.0.0 TCP_MISS/200 6223 GET http://googleads.g.doubleclick.net/pagead/ads? - DIRECT/74.125.234.89 text/html
1325004158.500 426 114.0.0.0 TCP_MISS/200 337 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004158.599 778 114.0.0.0 TCP_MISS/200 11599 GET http://img.vivaolinux.com.br/imagens/banners/banner-com7-01.jpg - DIRECT/174.123.53.162 image/jpeg
1325004159.006 285 114.0.0.0 TCP_MISS/200 2710 GET http://googleads.g.doubleclick.net/pagead/ads? - DIRECT/74.125.234.89 text/html
1325004166.096 22147 114.0.0.0 TCP_MISS/200 895 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004178.377 1232 114.0.0.0 TCP_MISS/200 695 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004178.816 438 114.0.0.0 TCP_MISS/200 337 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004198.762 939 114.0.0.0 TCP_MISS/200 338 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004218.572 52474 114.0.0.0 TCP_MISS/200 1307 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004218.797 673 114.0.0.0 TCP_MISS/200 1391 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004219.227 430 114.0.0.0 TCP_MISS/200 336 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004239.207 1269 114.0.0.0 TCP_MISS/200 338 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004245.243 26671 114.0.0.0 TCP_MISS/200 1118 POST http://by2msg3020405.gateway.messenger.live.com/gateway/gateway.dll? - DIRECT/64.4.34.190 text/html
1325004259.195 804 114.0.0.0 TCP_MISS/200 1292 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger
1325004259.656 460 114.0.0.0 TCP_MISS/200 338 POST http://207.46.124.195/gateway/gateway.dll? - DIRECT/207.46.124.195 application/x-msn-messenger

o comando ainda nao havia chago ao final de execucao.


6. Re: Squid não geral log

Reginaldo de Matias
saitam

(usa Slackware)

Enviado em 27/12/2011 - 15:45h

ok, agora posta seu squid.conf


7. squid.conf

Marcos Aurelio de Souza
marcos.ti

(usa Red Hat)

Enviado em 27/12/2011 - 15:51h

#PORTA QUE O SQUID UTILIZA
http_port 3128

#NOME DO PROXY
visible_hostname Proxy
#QUANTIDADE DE RAM QUE O SQUID UTILIZA
cache_mem 128 MB

#TAMANHO MAXIMO PARA AQUIVOS EM CACHE
maximum_object_size_in_memory 64 KB

#TAMANHO MAXIMO E MINIMO PARA DOWNLOAD
maximum_object_size 512 MB
minimum_object_size 0 KB

#CONTROLE DO CACHE
cache_swap_low 90
cache_swap_high 95

#DIRETORIO CACHE QUE ARMAZENA AS PAGINAS VISITADAS
cache_dir ufs /var/spool/squid 1024 16 256

# Arquivo onde serao guardados os logs de acesso do squid:
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
error_directory /usr/share/squid/errors/Portuguese
cache_store_log none


emulate_httpd_log off
client_netmask 255.255.255.0
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 21 80 443 563 70 210 59 901 1025-65535
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 #multilink http
acl SSL_ports port 901 # SWAT
acl internet port 443
acl purge method PURGE
acl CONNECT method CONNECT
acl minharede src 114.0.0.0/24
#-----------------------------------------------------------------
#bloquear msn

acl msn_regex url_regex -i gateway.dll
acl msn_lock urlpath_regex -i "/etc/squid/msn_bloqueados/bloqueados.txt"
acl msn_opec dstdomain loginnet.passport.com
#-----------------------------------------------------------------
#Liberar msn

acl msn_open src "/etc/squid/msn_liberados/liberados.txt"
#-----------------------------------------------------------------
#bloquear downloads

acl download urlpath_regex "/etc/squid/downloads/downloads.txt"
#-----------------------------------------------------------------
#AVAST

acl avast url_regex -i "/etc/squid/avast/avast.txt"
#-----------------------------------------------------------------
#definir sites

acl sites_bloqueados url_regex -i "/etc/squid/sites_bloqueados/bloqueados.txt"
acl sites_liberados url_regex -i "/etc/squid/sites_liberados/liberados.txt"
#-----------------------------------------------------------------
#Definindo acesso por ip

acl nao_pode src "/etc/squid/ips_bloqueados/bloqueados.txt"
acl quem_pode src "/etc/squid/ips_liberados/liberados.txt"
#-----------------------------------------------------------------
#Definir acesso palavras

acl bloqueia_palavras url_regex -i "/etc/squid/palavras_bloqueadas/bloqueadas"
acl libera_palavras url_regex -i "/etc/squid/palavras_liberadas/liberadas.txt"
#-----------------------------------------------------------------
#define a regra criada acl

http_access allow quem_pode

http_access allow libera_palavras
http_access deny bloqueia_palavras
http_access deny sites_bloqueados

http_access deny download

http_access allow avast

http_access allow msn_regex msn_open
http_access allow msn_lock msn_open
http_access allow msn_opec msn_open

http_access deny msn_regex
http_access deny msn_lock
http_access deny msn_opec

http_access deny nao_pode !internet !sites_liberados

http_access allow manager localhost
http_access deny manager
http_access allow localhost
http_access allow minharede
http_access allow Safe_ports
http_access allow CONNECT SSL_ports
http_access deny all


8. Re: Squid não geral log

Reginaldo de Matias
saitam

(usa Slackware)

Enviado em 27/12/2011 - 17:24h

proxy transparent faça:
No squid.conf
http_port 3128 transparent

e adicione a regra iptables no seu script de firewall

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128


Nota: eth1=interface de rede local se no seu caso for outra substitui pela interface de rede local.

reinicia o squid e teste, depois mande o feedback aqui.


9. continuando

Marcos Aurelio de Souza
marcos.ti

(usa Red Hat)

Enviado em 27/12/2011 - 17:32h

squid (pid 9067 9065) est rodando...
FATAL: Bungled squid.conf line 2: http_port 3128 transparent
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.004 seconds = 0.001 user + 0.003 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
/etc/init.d/squid: line 121: 9291 Abortado $SQUID -k check


bom, no iptables esta rodando ok...preciso configurar o proxy no navegador, com a porta do squid...porem da este erro ao carregar o squid.







Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts