Página 2 de 13 PrimeiroPrimeiro 1234567 ... ÚltimoÚltimo
+ Responder ao Tópico



  1. #21

    Padrão

    maninho coloquei seu script e tah executando
    Warning: bad ps syntax, perhaps a bogus '-'? See procps - Frequently Asked Questions (FAQ)
    proxy 1449 12.9 12.9 287892 266084 ? Rl 00:14 0:38 (squid) -D syC
    proxy 1504 0.1 0.0 11280 1692 ? Ss 00:18 0:00 /usr/bin/perl /etc/squid/store_url_orkut
    proxy 1505 0.0 0.0 11280 1684 ? Ss 00:18 0:00 /usr/bin/perl /etc/squid/store_url_orkut
    proxy 1506 0.0 0.0 11280 1684 ? Ss 00:18 0:00 /usr/bin/perl /etc/squid/store_url_orkut
    proxy 1507 0.0 0.0 11280 1680 ? Ss 00:18 0:00 /usr/bin/perl /etc/squid/store_url_orkut
    proxy 1508 0.0 0.0 11280 1616 ? Ss 00:18 0:00 /usr/bin/perl /etc/squid/store_url_orkut
    root 1523 0.0 0.0 4988 768 pts/0 R+ 00:19 0:00 grep squid
    root 25830 0.0 0.0 15992 980 ? Ss Jul08 0:00 squid -D syC


    só nao tah redirecionando

    tem como faze um debug.log pro pra por no tipo echo >> /tmp/debug.log

    ae dentro os parametros:

    entrada: $entrada
    saida: $saida

    soh pra analizar??

    bração!



    image/jpeg
    1215659928.655 16 189.10.203.13 TCP_IMS_HIT/304 306 GET http://img1.orkut.com/images/small/1...7738164/ln.jpg - NONE/- image/jpeg
    1215659928.686 12 189.10.203.13 TCP_IMS_HIT/304 306 GET http://img1.orkut.com/images/small/1...4/37621263.jpg - NONE/- image/jpeg
    1215659928.690 0 189.10.203.13 TCP_IMS_HIT/304 305 GET http://img1.orkut.com/img/castro/p_scrap.gif - NONE/- image/gif
    1215659928.693 14 189.10.203.13 TCP_IMS_HIT/304 306 GET http://img1.orkut.com/images/small/1...5/14654978.jpg - NONE/- image/jpeg
    1215659928.703 0 189.10.203.13 TCP_IMS_HIT/304 305 GET http://www.orkut.com.br/img/smiley/i_bigsmile.gif - NONE/- image/gif
    1215659928.705 33 127.0.0.1 TCP_MISS/200 654 GET http://img3.orkut.com/img/castro/btnbox_r.gif - DIRECT/209.85.193.94 image/gif
    1215659928.705 37 189.10.203.13 TCP_MISS/200 753 GET http://img3.orkut.com/img/castro/btnbox_r.gif - DEFAULT_PARENT/127.0.0.1 image/gif
    1215659928.712 67 127.0.0.1 TCP_MISS/200 2129 GET http://img2.orkut.com/images/small/1...055/966526.jpg - DIRECT/209.85.193.94 image/jpeg
    1215659928.713 70 189.10.203.13 TCP_MISS/200 2228 GET http://img2.orkut.com/images/small/1...055/966526.jpg - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215659928.747 65 127.0.0.1 TCP_MISS/200 1630 GET http://img4.orkut.com/images/small/1...3454224/ln.jpg - DIRECT/209.85.193.86 image/jpeg
    1215659928.749 68 189.10.203.13 TCP_MISS/200 1729 GET http://img4.orkut.com/images/small/1...3454224/ln.jpg - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215659928.767 95 127.0.0.1 TCP_MISS/200 2128 GET http://img4.orkut.com/images/small/1...2426756/ln.jpg - DIRECT/209.85.193.85 image/jpeg
    1215659928.769 98 189.10.203.13 TCP_MISS/200 2227 GET http://img4.orkut.com/images/small/1...2426756/ln.jpg - DEFAULT_PARENT/127.0.0.1 image/jpeg

  2. #22

    Padrão

    Fiz as modificações no script, tenta aí e posta o resultado do arquivo, por favor.

    Código :
    #!/usr/bin/perl
    $|=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 "302:$url\n";
            } else {
                    print $fh "nao redirecionado\n";
                    print "\n";
            }
            close $fh;
    }

  3. #23

    Padrão

    brother tu é o cara!

    wireless:/tmp# tail -f debug_url_redirect.log
    entrada: http://img2.orkut.com/images/small/1...1/24731261.jpg
    saida: http://img1.orkut.com/images/small/1...1/24731261.jpg
    entrada: http://img4.orkut.com/images/small/1...7400500/uf.jpg
    saida: http://img1.orkut.com/images/small/1...7400500/uf.jpg
    entrada: http://img4.orkut.com/images/small/1...7400500/uf.jpg
    saida: http://img1.orkut.com/images/small/1...7400500/uf.jpg
    entrada: http://img4.orkut.com/images/small/1...7282421/ln.jpg
    saida: http://img1.orkut.com/images/small/1...7282421/ln.jpg
    entrada: http://img4.orkut.com/images/small/1...7282421/ln.jpg
    saida: http://img1.orkut.com/images/small/1...7282421/ln.jpg
    entrada: http://img2.orkut.com/images/klein/24/13394724.jpg
    saida: http://img1.orkut.com/images/klein/24/13394724.jpg
    entrada: http://img2.orkut.com/images/klein/24/13394724.jpg
    saida: http://img1.orkut.com/images/klein/24/13394724.jpg
    entrada: http://img4.orkut.com/images/klein/1...0/14561600.jpg
    saida: http://img1.orkut.com/images/klein/1...0/14561600.jpg
    entrada: http://img4.orkut.com/images/klein/1...0/14561600.jpg
    saida: http://img1.orkut.com/images/klein/1...0/14561600.jpg
    entrada: http://img2.orkut.com/images/klein/1...798/543458.jpg
    saida: http://img1.orkut.com/images/klein/1...798/543458.jpg
    entrada: http://img2.orkut.com/images/klein/1...798/543458.jpg
    saida: http://img1.orkut.com/images/klein/1...798/543458.jpg
    entrada: http://img4.orkut.com/images/milieu/...pg?sig=1ixa5rs
    saida: http://img1.orkut.com/images/milieu/...pg?sig=1ixa5rs


    só não sei oq tah avendo pq nos log ele nao redireciona sca soh

    215695635.650 73 189.10.203.20 TCP_MISS/200 3239 GET http://img3.orkut.com/images/chhota/...tid=1215637511 - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215695635.661 70 127.0.0.1 TCP_MISS/200 2485 GET http://img3.orkut.com/images/chhota/...tid=1215633147 - DIRECT/209.85.193.94 image/jpeg
    1215695635.662 73 189.10.203.20 TCP_MISS/200 2584 GET http://img3.orkut.com/images/chhota/...tid=1215633147 - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215695635.876 33 127.0.0.1 TCP_MISS/200 2392 GET http://img3.orkut.com/images/chhota/...tid=1215632711 - DIRECT/209.85.193.94 image/jpeg
    1215695635.878 79 189.10.203.20 TCP_MISS/200 2491 GET http://img3.orkut.com/images/chhota/...tid=1215632711 - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215695636.100 32 127.0.0.1 TCP_MISS/200 2543 GET http://img3.orkut.com/images/chhota/...tid=1215632577 - DIRECT/209.85.193.94 image/jpeg
    1215695636.101 82 189.10.203.20 TCP_MISS/200 2642 GET http://img3.orkut.com/images/chhota/...tid=1215632577 - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215695637.193 366 127.0.0.1 TCP_MISS/200 21124 GET http://www.orkut.com.br/AlbumZoom.as...=1214919946894 - DIRECT/209.85.193.85 text/html
    1215695637.221 32 127.0.0.1 TCP_MISS/200 2530 GET http://img3.orkut.com/images/small/1...5/71612430.jpg - DIRECT/209.85.193.94 image/jpeg
    1215695637.223 35 189.10.203.20 TCP_MISS/200 2629 GET http://img3.orkut.com/
    1215695746.293 129 127.0.0.1 TCP_MISS/200 2832 GET http://img4.orkut.com/images/klein/1202699362/55713.jpg - DIRECT/209.85.193.86 image/jpeg
    1215695746.295 131 189.10.203.20 TCP_MISS/200 2931 GET http://img4.orkut.com/images/klein/1202699362/55713.jpg - DEFAULT_PARENT/127.0.0.1 image/jpeg
    1215695747.470 64 127.0.0.1 TCP_MISS/200 2011 GET http://img2.orkut.com/images/klein/52/12116652.jpg - DIRECT/209.85.193.94 image/jpeg
    1215695747.471 77 189.10.203.20 TCP_MISS/200 2110 GET http://img2.orkut.com/images/klein/52/12116652.jpg


    olha como fiz

    acl store_rewrite_list dstdomain img2.orkut.com img3.orkut.com img4.orkut.com img5.orkut.com img6.orkut.com img7.orkut.com img8.orkut.com img9.orkut.com

    storeurl_access allow store_rewrite_list
    storeurl_access deny all
    storeurl_rewrite_program /etc/squid/store_url_orkut2

  4. #24

    Padrão

    brother qual a moral desse 302 aqui do seu código?!

    print "302:$url\n";


    ? abraços

  5. #25

    Padrão

    Esse 302 é o código HTTP para página redirecionada.

    Você já tentou entrar com a url da imagem direto no browser?

  6. #26

    Padrão

    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

  7. #27

    Padrão

    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.

  8. #28

    Padrão

    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 15:17.

  9. #29

    Padrão

    maninho vamos aprimorar esse script ai!!! ;P

    consegue faze um IF dentro dele

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

  10. #30

    Padrão

    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;
    }

  11. #31

    Padrão

    Citação Postado originalmente por galahad Ver Post
    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;
    }
    o avast é de de download000ádownload999 vai funga tbm irmão?!

  12. #32

    Padrão

    vai sim... sem nenhum problema!

  13. #33

    Padrão

    Citação Postado originalmente por lucianogf Ver Post
    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.
    to removendo por 2 motivos!

    1 enconomia de link porque TODOS OS HITS vao ser traduzidos para
    img1.orkut

    2 acabar com duplicidade de arquivos dentro do cache economizando espaço precioso...

    para orkut... avast... e todos os mais utilizados... orkut de fotinho em fotinho duplicada cada uma nove vezes vai um bom espaço e banda...

    avast us update sao de até 15 megas ae baixo uma vez nao vai dah mais cache misss... por esses motivos minha intençao é deixar o proxy o mais perfeito possivel... vou começar com os fáceis para ter uma base .. e melhorar minha skill hehehe depois parto pros dificieis..
    youtube... pornotube... redtube .. acho que os pornos tão mais vistos que o youtube utimamente hahahahahah

  14. #34

    Padrão

    Citação Postado originalmente por galahad Ver Post
    vai sim... sem nenhum problema!
    tu é o cara =D

    mais me explica como funciona aquele [0-9]

    é pra receber um numeral de até 9 digitos? tipo download1

    download12
    download123
    download1234
    download12345
    download123456
    download1234567
    download...................
    download123456789

    ?

  15. #35

    Padrão

    Na verdade aquele [0-9] é um regex que casa com qualquer número de 0 a 9, e o {3} é um regex que só vai casar se forem três algarismos. Ou seja, [0-9]{3} == [0-9][0-9][0-9] == 000 - 999, entendeu?

  16. #36

    Padrão

    se quiser botar mais hots entao agora só eu ir acrscentando

    elseif ($url =~ /^http:\/\/inicio[0-9]{3}.host.com/) {
    $url =~ s/inicio[0-9]{3}/novoinicio/;
    print $fh "saida: $url\n";
    print "$url\n";
    }


    é isso?

    tem como explicar?

    Abraçao

  17. #37

    Padrão

    saquei valeu =D

  18. #38

    Padrão

    depois que estiver com tudo OK coloca no wiki, assim é melhor até para atualizações.

  19. #39

    Padrão

    Citação Postado originalmente por lucianogf Ver Post
    depois que estiver com tudo OK coloca no wiki, assim é melhor até para atualizações.

    pode deixa!! vo larga lá um squid samuray pra nos desbancar o ninja! ;D hehehe


    abraço!

  20. #40

    Padrão

    testei o codigo novo tah trancando o squid :/



    Código :
    #!/usr/bin/perl
    #X[0]-> URL EX: IMG1.ORKUT.COM
    #X[1]-> CLIENT IP: 189.10.203.13/ANGEL.GINET.COM.BR
    #X[2]-> -
    #X[3]-> GET ou POST
    #X[4]-> -
    #X[5]-> MYIP : 189.10.203.1 OU 127.0.0.1
    #X[6]-> MYPORT EX: 8012
    $|=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}/download605/;
                    print $fh "saida: $url\n";
                    print "$url\n";
            } else {
                    print $fh "nao redirecionado\n";
                    print "\n";
            }
            close $fh;



    apesar de estar injetando normal (conferi pelo velho só habilitei pra o dominio avast.com tbm passar pelo redirector)

    entrada: http://img1.orkut.com/js/gen/groups009.js
    nao redirecionado
    entrada: http://download933.avast.com/iavs4x/..._pro.vpu.stamp
    nao redirecionado
    entrada: http://download933.avast.com/iavs4x/vpsm-8070800.vpu
    nao redirecionado
    entrada: http://download933.avast.com/cgi-bin/iavs4stats.cgi
    nao redirecionado
    entrada: http://download933.avast.com/cgi-bin/iavs4stats.cgi


    se eu coloco o script novo ele tranca