+ Responder ao Tópico



  1. #1

    Padrão Squid.. Nao Ta Liberando

    Aew Povo..
    Olha so.. tenho que fazer o squid bloquear todos os sites.. e liberar apenas alguns sites..
    Porem nao ta dando mto certo.. quem sabe alguem aí entenda o que eu to fazendo de errado..
    ------------------------------------------------------------------------------------
    squid.conf
    -----
    http_port 3128
    hierarchy_stoplist cgi-bin ?
    acl QUERY urlpath_regex cgi-bin \?
    no_cache deny QUERY
    httpd_accel_port 80
    httpd_accel_host virtual
    httpd_accel_with_proxy on
    httpd_accel_uses_host_header on

    auth_param basic children 5
    auth_param basic realm Squid proxy-caching web server
    auth_param basic credentialsttl 2 hours
    refresh_pattern ^ftp: 1440 20% 10080
    refresh_pattern ^gopher: 1440 0% 1440
    refresh_pattern . 0 20% 4320

    ## ACL
    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 to_localhost dst 127.0.0.0/8
    acl SSL_ports port 443 563
    acl Safe_ports port 80 # http
    acl Safe_ports port 21 # ftp
    acl Safe_ports port 443 563 # https, snews
    acl Safe_ports port 70 # gopher
    acl Safe_ports port 210 # wais
    acl Safe_ports port 1025-65535 # portas desconhecidas
    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 liberar url_regex -i "/home/adm/liberados.txt"

    http_access deny CONNECT !SSL_ports
    http_access allow localhost
    http_access allow manager localhost
    http_access deny manager
    http_access deny !Safe_ports
    http_access deny !liberar
    http_reply_access allow all
    icp_access allow all

    cache_dir ufs /var/squid/cache 4048 16 256
    cache_mem 32 mb
    cache_swap_low 90
    cache_swap_high 95
    maximum_object_size 4096 KB
    minimum_object_size 0 KB
    maximum_object_size_in_memory 8 KB

    cache_access_log /var/squid/logs/access.log
    cache_log /var/squid/logs/cache.log
    cache_store_log /var/squid/logs/store.log

    coredump_dir none
    -------------------------------------------------------------------------------
    e no /home/adm/liberados.txt
    ----------
    globo.com
    terra.com.br
    under-linux.org
    blablabla.com.br


    Sei lá.. a primeira vez q to fazendo um proxy..
    Que vcs acham que pode ser.. ele ta bloqueando tudo..


    Valeu

  2. #2
    wrochal
    Visitante

    Padrão Squid.. Nao Ta Liberando

    Caro,

    Eu usei as seguintes acls, e comigo funcionou:

    criei os arquivos liberados e bloqueados

    conteudo do bloqueados:

    .*

    liberados:

    .uol.com.br
    .linuxit.com.br
    .osnews.com

    e fiz a seguinte regra

    acl liberados url_regex "/etc/squid/liberados"
    acl bloqueados url_regex "/etc/squid/bloqueados"
    http_access deny bloqueados !liberados
    acl rede src 192.168.0.0/24
    http_access allow rede


    Testei e funcionou normal, qualquer dúvida retorne...

  3. #3

    Padrão Squid.. Nao Ta Liberando

    Faz assim oh:

    Código :
    acl blocked url_regex -i "/etc/squid/blocked"
    acl unblocked url_regex -i "/etc/squid/unblocked"
    http_access deny blocked !unblocked

    Mais informações, leia http://www.giboia.org e caça o link sobre Squid na homepage.


    Abraços!

  4. #4
    wrochal
    Visitante

    Padrão Squid.. Nao Ta Liberando

    Nao percebi nada diferente do q citei acima...

  5. #5
    Júnior_SAP
    Visitante

    Padrão Re: Squid.. Nao Ta Liberando

    Citação Postado originalmente por budairc
    Aew Povo..
    Olha so.. tenho que fazer o squid bloquear todos os sites.. e liberar apenas alguns sites..
    Porem nao ta dando mto certo.. quem sabe alguem aí entenda o que eu to fazendo de errado..
    ------------------------------------------------------------------------------------
    squid.conf
    -----
    http_port 3128
    hierarchy_stoplist cgi-bin ?
    acl QUERY urlpath_regex cgi-bin \?
    no_cache deny QUERY
    httpd_accel_port 80
    httpd_accel_host virtual
    httpd_accel_with_proxy on
    httpd_accel_uses_host_header on

    auth_param basic children 5
    auth_param basic realm Squid proxy-caching web server
    auth_param basic credentialsttl 2 hours
    refresh_pattern ^ftp: 1440 20% 10080
    refresh_pattern ^gopher: 1440 0% 1440
    refresh_pattern . 0 20% 4320

    ## ACL
    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 to_localhost dst 127.0.0.0/8
    acl SSL_ports port 443 563
    acl Safe_ports port 80 # http
    acl Safe_ports port 21 # ftp
    acl Safe_ports port 443 563 # https, snews
    acl Safe_ports port 70 # gopher
    acl Safe_ports port 210 # wais
    acl Safe_ports port 1025-65535 # portas desconhecidas
    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 liberar url_regex -i "/home/adm/liberados.txt"

    http_access deny CONNECT !SSL_ports
    http_access allow localhost
    http_access allow manager localhost
    http_access deny manager
    http_access deny !Safe_ports
    http_access deny !liberar
    http_reply_access allow all
    icp_access allow all

    cache_dir ufs /var/squid/cache 4048 16 256
    cache_mem 32 mb
    cache_swap_low 90
    cache_swap_high 95
    maximum_object_size 4096 KB
    minimum_object_size 0 KB
    maximum_object_size_in_memory 8 KB

    cache_access_log /var/squid/logs/access.log
    cache_log /var/squid/logs/cache.log
    cache_store_log /var/squid/logs/store.log

    coredump_dir none
    -------------------------------------------------------------------------------
    e no /home/adm/liberados.txt
    ----------
    globo.com
    terra.com.br
    under-linux.org
    blablabla.com.br


    Sei lá.. a primeira vez q to fazendo um proxy..
    Que vcs acham que pode ser.. ele ta bloqueando tudo..


    Valeu

    Então cara, seguinte, não sou especialista em squid, já apanhei um pouco mais acho q tá faltando a linha http_access allow liberar em baixo da acl liberar, blz...

    Espero ter ajudado...

    []'s Júnior_SAP