Página 6 de 50 PrimeiroPrimeiro ... 234567891011 ... ÚltimoÚltimo
+ Responder ao Tópico



  1. vamo lá maninho!!!!



    vo precisa da sua ajuda prá nos achar a soluição!

    veja bem a sintaxe de entrada que tem que ter mesma saida


    URL <SP> client_ip "/" fqdn <SP> user <SP> method <SP> urlgroup
    [<SP> kvpairs] <NL>


    e a observação do comando:

    Please note - the normal URL rewriter rewrites Squid's _destination_
    URL - ie, what it fetches. The Store URL rewriter rewrites Squid's
    _store_ URL - ie, what it uses to store and retrieve objects.

    pelo que entendi a url

    ele força o redirecionamento no browser não é?


    o url_rewrite_program
    tem mesma entrada e saida

    mais a explicação:

    The rewriter can also indicate that a client-side redirect should
    be performed to the new URL. This is done by prefixing the returned
    URL with "301:" (moved permanently) or 302: (moved temporarily).

    It can also return a "urlgroup" that can subsequently be matched
    in cache_peer_access and similar ACL driven rules. An urlgroup is
    returned by prefixing the returned URL with "!urlgroup!".


    que faz de fato o redirecionamento no proxy mesmo através do cache_peer(e é oque devemos usar) não é isso?


    to ainda sem durmi fiquei ontem ateh as 5 brincando com isso ehhehe


    mais saca soh peguei seu script e fiz isso aki

    Código :
    #!/usr/bin/perl
    $|=1;
    while (<>) {
            open $fh, ">>/tmp/debug_url_redirect.log";
            @X = split;
            $url = $X[0];
            $client = $X[1];
            $nada = $X[2];
            $metodo = $X[3];
            $nada2 = $X[4];
            $myip = $X[5];
            $myport = $X[6];
            print $fh "entrada: $url $client $nada $metodo $nada2 $myip $myport\n";
            if ($url =~ /^http:\/\/img[2-9]\.orkut\.com.*/) {
                    $url =~ s/img[0-9]/img1/;
                    print $fh "saida: $url $client $nada $metodo $nada2 $myip $myport\n";
                    print "$url $client $nada $metodo $nada2 $myip $myport\n";
            } else {
                    print $fh "nao redirecionado\n";
                    print "\n";
            }
            close $fh;
    }
    não entendo porcarinha nenhuma de perl foi apenas por intuição do ARRAY
    pra dizer a verdade nao sei a moral daquele $|=1
    enem como surge essa variavel @X que vir array eheheh

    mais agora agora o log ficou assim:

    Código :
    entrada: http://img2.orkut.com/images/small/1214857291/66827875/ln.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    saida: http://img1.orkut.com/images/small/1214857291/66827875/ln.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    entrada: http://img4.orkut.com/images/small/1215120556/181627402/ln.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    saida: http://img1.orkut.com/images/small/1215120556/181627402/ln.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    entrada: http://img2.orkut.com/images/small/1214857291/66827875/ln.jpg 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8012
    saida: http://img1.orkut.com/images/small/1214857291/66827875/ln.jpg 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8012
    entrada: http://img4.orkut.com/images/small/1215120556/181627402/ln.jpg 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8012
    saida: http://img1.orkut.com/images/small/1215120556/181627402/ln.jpg 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8012
    entrada: http://img4.orkut.com/images/small/1210449045/40354090.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    saida: http://img1.orkut.com/images/small/1210449045/40354090.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    entrada: http://img4.orkut.com/images/small/1210449045/40354090.jpg 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8012
    saida: http://img1.orkut.com/images/small/1210449045/40354090.jpg 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8012
    entrada: http://img4.orkut.com/images/small/1213648220/65548598/ln.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    saida: http://img1.orkut.com/images/small/1213648220/65548598/ln.jpg 189.10.203.20/moster.ginet.com.br - GET - myip=189.10.203.1 myport=8012
    entrada: http://img4.orkut.com/images/small/1213648220/65548598/ln.jpg 127.0.0.1/localhost - GET - myip=127.0.0.1 myport=8012
    saida:
    todavia ainda nao é igual ao layout de entrada e saida do url_rewrite_program
    que presumo ter de ser identicos!

    URL <SP> client_ip "/" fqdn <SP> user <SP> method <SP> urlgroup
    [<SP> kvpairs] <NL>




    store.log atual (nada de redirect aparente)
    Código :
    OUeSP0QMwrSM59uEzTFbz0WB5ONk-NhJitJ4Pd6mzZdnzn9fXgIy5lnCE-JdVfSQc3-XDZF90a_sYUS2U84NXH2RGE5IciEudlcuT5dYPiqHhXy0NK1xN7k7msk7r4--rQyv6zvqOih_TihGG583b80nOpLr3YH56nfhFAJgVC1M9aGUIOD1j_8ed9kd6c2-wZExlAcOr_
    1215798312.452 RELEASE -1 FFFFFFFF D6822075FFD3FC06A359E15BE2226B8D  302 1215797842        -1 1215797842 text/html 423/423 GET http://www.orkut.com.br/Home.aspx
    1215798312.454 RELEASE -1 FFFFFFFF 7154AB0182F1288085F081A72ED75F27  302 1215797842        -1 1215797842 text/html 423/423 GET http://www.orkut.com.br/Home.aspx
    1215798313.507 RELEASE -1 FFFFFFFF 85CAAC5C00CB9E5D4435CC88DEB15895  302 1215797843        -1 631152000 text/html 215/215 GET http://www.orkut.com.br/RedirLogin.aspx?msg=0&page=http%3A%2F%2Fwww.orkut.com.br%2FHome.aspx&pli=1&auth=DQAAAJYAAAC0dV3dF0Z2ErHIRDWRc1k85EqQ8HoPO5ICxSaP621MhWoz9naKJNpGbtbXNUo6wDk9qjnmohjgXG07MbErQbUDtOUmt8XA4HHmkL1TinGxmUrDzhtkKrozWHKTSnUZUJkA590m_J7gkyH1w7iQK4rApoZ9eogLh4iFJwvx58W4KG89cZgcP7YJ30TIyLp64Fp8woZ2qZOKsuG9mCQtqULt
    1215798313.510 RELEASE -1 FFFFFFFF 4F9050583C96FA8E7A05977ABB75DE1E  302 1215797843        -1 631152000 text/html 215/215 GET http://www.orkut.com.br/RedirLogin.aspx?msg=0&page=http%3A%2F%2Fwww.orkut.com.br%2FHome.aspx&pli=1&auth=DQAAAJYAAAC0dV3dF0Z2ErHIRDWRc1k85EqQ8HoPO5ICxSaP621MhWoz9naKJNpGbtbXNUo6wDk9qjnmohjgXG07MbErQbUDtOUmt8XA4HHmkL1TinGxmUrDzhtkKrozWHKTSnUZUJkA590m_J7gkyH1w7iQK4rApoZ9eogLh4iFJwvx58W4KG89cZgcP7YJ30TIyLp64Fp8woZ2qZOKsuG9mCQtqULt
    1215798314.770 RELEASE -1 FFFFFFFF B975B6209E7E7A29CD9C8352D0270498  302 1215797844        -1 1215797844 text/html 423/423 GET http://www.orkut.com.br/Home.aspx
    1215798314.772 RELEASE -1 FFFFFFFF 3A73E95C028C847A2FCBA4A8A11789C2  302 1215797844        -1 1215797844 text/html 423/423 GET http://www.orkut.com.br/Home.aspx
    1215798315.376 RELEASE 00 0018A01C 0797AC08E6BFFA7223022792C50A5830  200 1215797845 1215533835 1247333845 image/jpeg 2318/2318 GET http://img4.orkut.com/images/small/1215533835/29429459/ln.jpg
    1215798315.969 RELEASE -1 FFFFFFFF 30EAA653CB22442F0773598B3F72AC24  302 1215797846        -1 631152000 text/html 215/215 GET http://www.orkut.com.br/RedirLogin.aspx?msg=0&page=http%3A%2F%2Fwww.orkut.com.br%2FHome.aspx&pli=1&auth=DQAAAJcAAABVjiEgHkPW4vhcIy9YtPZi8IU5fctpYcpgI0s2Jbrv8lurBF5kHaHZ90KV_25njfJ_Kg1rO_g-b2Axa3xRcSoHhwO8shjrKZCOriN0O9ezYmlD5iJJPJ8RhFOCGzUuZPNoEse-dNXZVzrGD06Ni9NSlA2SC6uZkTILGROSDODaVUJEsBmKMLCFvpRWM1YbaVeB-lz8ShmJTQC7BPPmDelr
    1215798315.972 RELEASE -1 FFFFFFFF 8192D1E2C76DEA98B651CC6345F5DC93  302 1215797846        -1 631152000 text/html 215/215 GET http://www.orkut.com.br/RedirLogin.aspx?msg=0&page=http%3A%2F%2Fwww.orkut.com.br%2FHome.aspx&pli=1&auth=DQAAAJcAAABVjiEgHkPW4vhcIy9YtPZi8IU5fctpYcpgI0s2Jbrv8lurBF5kHaHZ90KV_25njfJ_Kg1rO_g-b2Axa3xRcSoHhwO8shjrKZCOriN0O9ezYmlD5iJJPJ8RhFOCGzUuZPNoEse-dNXZVzrGD06Ni9NSlA2SC6uZkTILGROSDODaVUJEsBmKMLCFvpRWM1YbaVeB-lz8ShmJTQC7BPPmDelr
    1215798316.087 SWAPOUT 00 0018A026 99A243DDEA352CF51BF73CE99B1EE6A2  200 1215797846 1212868473 1247333846 image/jpeg 3025/3025 GET http://img3.orkut.com/images/medium/1212868473/19747659/ln.jpg
    1215798316.089 RELEASE 00 0018A026 0A62B2AD54F04D3285D9C663CF1F1814  200 1215797846 1212868473 1247333846 image/jpeg 3025/3025 GET http://img3.orkut.com/images/medium/1212868473/19747659/ln.jpg
    1215798316.090 SWAPOUT 00 0018A026
    access.log atual (nada de redirect aparente ainda)

    Código :
    1215798449.210      2 189.10.203.20 TCP_HIT/200 1368 GET http://img1.orkut.com/images/small/1214334295/87112119/ln.jpg - NONE/- image/jpeg
    1215798449.415    362 127.0.0.1 TCP_MISS/200 21248 GET http://www.orkut.com.br/AlbumZoom.aspx?uid=11685979526798855119&aid=1215682597&pid=1215707956738 - DIRECT/209.85.193.85 text/html
    1215798449.424    395 189.10.203.20 TCP_MISS/200 21347 GET http://www.orkut.com.br/AlbumZoom.aspx?uid=11685979526798855119&aid=1215682597&pid=1215707956738 - DEFAULT_PARENT/127.0.0.1 text/html
    1215798449.459      4 189.10.203.20 TCP_HIT/200 589 GET http://img2.orkut.com/img/castro/arr_expanded.gif - NONE/- image/gif
    1215798449.468     19 189.10.203.20 TCP_HIT/200 2873 GET http://img2.orkut.com/images/klein/1210145418/45026.jpg - NONE/- image/jpeg
    1215798449.482     56 189.10.203.20 TCP_HIT/200 2417 GET http://img1.orkut.com/images/klein/1204087725/999.jpg - NONE/- image/jpeg
    1215798449.500     35 127.0.0.1 TCP_MISS/200 4715 GET http://img2.orkut.com/images/medium/1214943794/200098817/ln.jpg - DIRECT/209.85.193.94 image/jpeg
    1215798449.500     39 127.0.0.1 TCP_MISS/200 2399 GET http://img2.orkut.com/images/klein/62/31302262.jpg - DIRECT/209.85.193.87 image/jpeg
    1215798449.503     45 189.10.203.20 TCP_MISS/200 2498 GET http://img2.orkut.com/images/klein/62/31302262.jpg - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215798449.504     42 189.10.203.20 TCP_MISS/200 4814 GET http://img2.orkut.com/images/medium/1214943794/200098817/ln.jpg - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215798449.514     65 127.0.0.1 TCP_MISS/200 1987 GET http://img2.orkut.com/images/klein/1214793681/22560/ln.jpg - DIRECT/209.85.193.85 image/jpeg
    1215798449.517     69 189.10.203.20 TCP_MISS/200 2086 GET

  2. cara..

    mas pq se tá fazendo todo esse trampo pro orkut? o squid faz cache dos objetos dele e libera como HIT, o seutubo (youtube) que é enroscado e precisaria de url_rewrite.



  3. MANINHOOOOOOOOOOOOOO brilhow
    era só questão de um intendimento melhor:


    saca soh
    Código :
      GET http://img1.orkut.com/images/small/1215132839/36261131/ln.jpg
    1215800019.361 SWAPOUT 00 0018C808 58AA209C74D5F0618B1953DD2E16DB08  200 1215799549 1215132839 1247335549 image/jpeg 1503/1503 GET http://img1.orkut.com/images/small/1215132839/36261131/ln.jpg
    1215800019.364 SWAPOUT 00 0018C80A 41E736EE585EBB878B31085D86E10437  200 1215799549 1208219090 1247335549 image/jpeg 1575/1575 GET http://img1.orkut.com/images/small/1208219091/59258862.jpg
    1215800019.366 RELEASE 00 0018C80A 6441C81A8EA66BC8A728C93EF19B0B51  200 1215799549 1208219090 1247335549 image/jpeg 1575/1575 GET http://img1.orkut.com/images/small/1208219091/59258862.jpg
    1215800019.366 SWAPOUT 00 0018C80B 41E736EE585EBB878B31085D86E10437  200 1215799549 1208219090 1247335549 image/jpeg 1575/1575 GET http://img1.orkut.com/images/small/1208219091/59258862.jpg
    1215800019.448 SWAPOUT 00 0018C80C 716098454EDDC8097160265021AACFBE  200 1215799549 1191773464 1247335549 image/jpeg 1696/1696 GET http://img1.orkut.com/images/small/1191773464/72811298.jpg
    1215800019.449 RELEASE 00 0018C80C 4BE67CCCCABEBC84E8151D860376AD6D  200 1215799549 1191773464 1247335549 image/jpeg 1696/1696 GET http://img1.orkut.com/images/small/1191773464/72811298.jpg
    1215800019.450 SWAPOUT 00 0018C80D 716098454EDDC8097160265021AACFBE  200 1215799549 1191773464 1247335549 image/jpeg 1696/1696 GET http://img1.orkut.com/images/small/1191773464/72811298.jpg
    1215800019.503 SWAPOUT 00 0018C80E 32CF8FBA908BA043C549D872E1BD001D  200 1215799549 1214489320 1247335549 image/jpeg 1644/1644 GET http://img1.orkut.com/images/small/1214489320/35055828/ln.jpg
    1215800019.504 RELEASE 00 0018C80E B7F60A92C4C79F67B8CE0FE41F0B22B4  200 1215799549 1214489320 1247335549 image/jpeg 1644/1644 GET http://img1.orkut.com/images/small/1214489320/35055828/ln.jpg
    1215800019.505 SWAPOUT 00 0018C80A 32CF8FBA908BA043C549D872E1BD001D  200 1215799549 1214489320 1247335549 image/jpeg 1644/1644 GET http://img1.orkut.com/images/small/1214489320/35055828/ln.jpg
    1215800019.533 SWAPOUT 00 0018C80C B8C2E3D784BF2BA7791D6A4290A50E2F  200 1215799549 1156436717 1247335549 image/jpeg 1740/1740 GET http://img1.orkut.com/images/klein/66/55666.jpg
    1215800019.535 RELEASE 00 0018C80C 54E2877EDC5236654C027097434B473C  200 1215799549 1156436717 1247335549 image/jpeg 1740/1740 GET http://img1.orkut.com/images/klein/66/55666.jpg
    1215800019.535 SWAPOUT 00 0018C80C B8C2E3D784BF2BA7791D6A4290A50E2F  200 1215799549 1156436717 1247335549 image/jpeg 1740/1740 GET http://img1.orkut.com/images/klein/66/55666.jpg
    1215800019.541 SWAPOUT 00 0018C80E 0BD10811516DCBBB0136CCB595E7571B  200 1215799549 1151109757 1247335549 image/jpeg 2905/2905 GET http://img1.orkut.com/images/klein/62/15787262.jpg
    1215800019.557 RELEASE 00 0018C80E 6FA809F4FF7B5B0245C9989BF5ECA54C  200 1215799549 1151109757 1247335549 image/jpeg 2905/2905 GET http://img1.orkut.com/images/klein/62/15787262.jpg
    1215800019.558 SWAPOUT 00 0018C80E 0BD10811516DCBBB0136CCB595E7571B  200 1215799549 1151109757 1247335549 image/jpeg 2905/2905 GET http://img1.orkut.com/images/klein/62/15787262.jpg
    1215800020.364 SWAPOUT 00 0018C813 B77C8DE0A8DB4B3E083A2161AE9F6934  200 1215799550 1197330572 1247335550 image/jpeg 1581/1581 GET http://img1.orkut.com/images/klein/1208890549/42801646.jpg
    1215800020.366 RELEASE 00 0018C813 661D31BB56BCD11D040729B18A3E9C10  200 1215799550 1197330572 1247335550 image/jpeg 1581/1581 GET http://img1.orkut.com/images/klein/1208890549/42801646.jpg
    1215800020.366 SWAPOUT 00 0018C813 B77C8DE0A8DB4B3E083A2161AE9F6934  200 1215799550 1197330572 1247335550 image/jpeg 1581/1581 GET http://img1.orkut.com/images/klein/1208890549/42801646.jpg
    wazaaaaaaaaaaaaa!!!!!!

    lá vai os codes

    entre os acl QUERY urlpath_regex cgi-bin \?
    e
    cache deny QUERY

    colocar:
    acl ORKUT dstdomain .orkut.com .orkut.com.br
    cache allow ORKUT


    Ficando:
    acl QUERY urlpath_regex cgi-bin \?
    acl ORKUT dstdomain .orkut.com .orkut.com.br
    cache allow ORKUT
    cache deny QUERY


    nos pattern:
    refresh_pattern orkut.com/.* 10080 100% 43200 override-expire override-lastmod reload-into-ims ignore-reload

    depois:

    storeurl_rewrite_children 70
    acl store_rewrite_list dstdomain .orkut.com
    url_rewrite_access allow store_rewrite_list
    url_rewrite_access deny all
    url_rewrite_program /etc/squid/store_url_orkut2



    o script em perl /etc/squid/store_url_orkut2

    Código :
    #!/usr/bin/perl
    $|=1;
    while (<>) {
            open $fh, ">>/tmp/debug_url_redirect.log";
            @X = split;
            $url = $X[0];
            $client = $X[1];
            $nada = $X[2];
            $metodo = $X[3];
            $nada2 = $X[4];
            $myip = $X[5];
            $myport = $X[6];
            print $fh "entrada: $url\n";
            if ($url =~ /^http:\/\/img[2-9]\.orkut\.com.*/) {
                    $url =~ s/img[0-9]/img1/;
                    print $fh "saida: $url\n";
                    print "$url\n";
            } else {
                    print $fh "nao redirecionado\n";
                    print "\n";
            }
            close $fh;
    }
    tive que tirar o 302 ! e deu pros cuturno!!!
    Última edição por arium; 11-07-2008 às 14:17.

  4. maninho vamos aprimorar esse script ai!!! ;P

    consegue faze um IF dentro dele

    if downloadxxx.avast.com redireciona pra downloadyyy.avast.com ? ;D



  5. tá aí:

    Código :
    $|=1;
    while (<>) {
            open $fh, ">>/tmp/debug_url_redirect.log";
            @X = split;
            $url = $X[0];
            print $fh "entrada: $url\n";
            if ($url =~ /^http:\/\/img[2-9]\.orkut\.com.*/) {
                    $url =~ s/img[0-9]/img1/;
                    print $fh "saida: $url\n";
                    print "$url\n";
            } elseif ($url =~ /^http:\/\/download[0-9]{3}.avast.com/) {
                    $url =~ s/download[0-9]{3}/downloadyyy/;
                    print $fh "saida: $url\n";
                    print "$url\n";
            } else {
                    print $fh "nao redirecionado\n";
                    print "\n";
            }
            close $fh;
    }






Tópicos Similares

  1. Squid. Msg de erro apó o STOP
    Por no fórum Servidores de Rede
    Respostas: 2
    Último Post: 25-08-2003, 13:42
  2. Squid - limite de usuarios (authenticate_children 32)
    Por Wal no fórum Servidores de Rede
    Respostas: 2
    Último Post: 01-08-2003, 17:32
  3. Usar Squid atraves de outro Proxy
    Por lucianotome no fórum Servidores de Rede
    Respostas: 4
    Último Post: 20-05-2003, 10:24
  4. Firewall + Squid ==> Estao de Ficando meio Maluco.
    Por A-Marcio no fórum Servidores de Rede
    Respostas: 0
    Último Post: 28-03-2003, 20:43
  5. Socorro - Squid parou de autenticar após atualização de paco
    Por Ganymede no fórum Servidores de Rede
    Respostas: 3
    Último Post: 17-02-2003, 13:17

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L