Então pessoal, lançado o novo ThunderCache 2.2, por enquanto segue o link, maiores informações serão postadas conforme forem divulgadas pelos autores.
Tentaremos fazer deste tópico um facilitador para o upgrade dos sistemas ThunderCache 2.1 atualmente instalados, se precisar de ajuda para a configuração seja claro onde esta sua dificuldade e faremos o possível para ajudá-lo desde que respeite as regras e faça uma boa busca no fórum antes de perguntar.
http://img515.imageshack.us/img515/9917/conlinux.png
1 - Incompatibilidade com os plugins da versão 2.1 e vice versa, sendo portanto necessário um upgrade total.
Download da versão atual:
http://189.75.242.85/thunder-v2.2.tar.bz2
Descompacte o conteúdo do thunder22 na pasta /etc/squid
wget http://189.75.242.85/thunder-v2.2.tar.bz2 #para baixar
tar -xvf thunder-v2.2.tar.bz2 #para descompactar, note que sera criada uma pasta, nela estão os arquivos novos, faça backup dos antigos antes de continuar
No squid.conf ao final
Código :url_rewrite_children 200 acl store_rewrite_list url_regex -i "/etc/squid/thunder.lst" url_rewrite_access allow store_rewrite_list url_rewrite_access deny all url_rewrite_program /etc/squid/loader.php acl localcache dstdomain 192.168.10.250 # < ip do servidor linux cache deny localcache
No thunder.lst
No thunder.conf:Código :http.*\.4shared\.com.*(\.exe|\.iso|\.torrent|\.zip|\.rar|\.pdf|\.doc|\.tar|\.mp3|\.mp4|\.avi|\.wmv) http.*\.avast\.com.*(\.def|\.vpu|\.vpaa|\.stamp) http.*(\.avg\.com|\.grisoft\.com).*(\.bin|\.exe) http.*(\.avgate\.com|\.avgate\.net|\.freeav\.net).*(\.dll\.gz|\.vdf\.gz) http.*flashvideo\.globo\.com.*(\.mp4|\.flv) http.*\.googlevideo\.com.*videoplayback http.*fpatch\.grandchase\.com\.br.*(\.kom|\.mkom|\.mp3) http.*(\.kaspersky-labs\.com|\.geo\.kaspersky\.com).*\.avc #http.*\storage\.mais\.uol\.com\.br.*\.flv #http.*\.orkut\.com.*\.jpg http.*\.pornhub\.com.*\.flv http.*\.redtube\.com\/_videos.*flv http.*\.terra\.com.*\.flv http.*media[a-z0-9]{2}\.tube8\.com.*.*\.flv http.*(\.windowsupdate\.com|\.microsoft\.com).*(\.cab|\.exe) http.*\.xvideos\.com.*\.flv http.*\.youtube\.com.*videoplayback http.*\.ytimg\.com.*watch_header\.jpg
No youtube.com.php usar o publicado pelo osmano em thundercache.org:Código :<?php $cache_dir = "/var/www/thunder"; $disk_max = 98; // percent $disk_ok = 90; //percents when clear cache $cache_scr = "/etc/squid"; $server_ip = "192.168.10.250"; // < ip do servidor linux $cache_url = "http://$server_ip/thunder"; $logadd_on = false; $proxy_host = ""; // keep it empty if you dont need proxy $proxy_port = "3128"; $redir = ""; //não utilizado $download_speed = 512; // kbytes $max_downloaders = 2; // limite de dois downloads por dominio para cada ip requisitante (cliente) // advanced params - IF YOU DONT KNOW, DONT TOUCH! $download_timeout = 10; $packet_size = 500; // in bytes $packet_delay = 2000;// time in micro second ?>
No loader.php seguir a dica do osmano da página 5 em thundercache.org:Código PHP:
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* (C) Copyright 2008-2009 Thunder Cache
*
* For more information check http://thundercache.org
*
* Plugin youtube.com
* Cache flash video files from youtube and googlevideo
* Need to put ".youtube.com" in squid.conf in line "acl store_rewrite_list dstdomain"
* best if you create symbolic link named "googlevideo.com.php" and put in squid.conf ".googlevideo.com"
*
* @author rodrigo manga <[email protected]>
*/
// confs
$save_quality = false;
$domain = "youtube";
if (!function_exists('get_videoid')){
function get_videoid($url) {
$return = "";
$url = preg_replace("/\?/","&",$url);
$url = explode("/",$url);
$url = $url[3];
$url = explode("&",$url);
foreach ($url as $valor){
$valor = explode("=",$valor);
if ($valor[0] == "id" || $valor[0] == "video_id") {
$return = $valor[1];
break;
}
}
return $return;
}
}
if (!function_exists('get_quality')){
function get_quality($url) {
$return = "";
$url = preg_replace("/\?/","&",$url);
$url = explode("/",$url);
$url = $url[3];
$url = explode("&",$url);
foreach ($url as $valor){
$valor = explode("=",$valor);
if ($valor[0] == "fmt") {
$return = $valor[1];
break;
}
}
return $return;
}
}
logadd("IN:($ip)$url");
if ( ( (strrpos($url,".googlevideo.com/") !== false) or (strrpos($url,".youtube.com/") !== false) ) and
( (strrpos($url,"/get_video?") !== false) or (strrpos($url,"/videoplayback?") !== false) ) and
( (strrpos($url,"id=") !== false) or (strrpos($url,"video_id=") !== false) ) and
(strrpos($url,"begin=") === false )
){
// get videoid
$videoid = get_videoid($url);
// get quality
if ($save_quality) {
$file=get_quality($url)."$videoid.flv";
}else{
$file="$videoid.flv";
}
// check if url need to pass
if ($file != ".flv") {
check_file($file,$url,$domain,$ip);
} else { // dont find file, repass url
print "$url\n";
logadd("OUT:$url (file empty: $file)");
}
} else {
// url not match
print "$url\n";
logadd("OUT:$url (dont match)");
}
?>
Utilizar o seguinte comando para trocar as permissões dos arquivos phpCódigo :de: if (file_exists("$cache_scr/plugins/$domain")) { include("$cache_scr/plugins/$domain"); para: if (file_exists("$cache_scr/$domain")) { include("$cache_scr/$domain");
Recarregar o squid com as alteraçõesCódigo :chmod a+x /etc/squid/*.php
Feito, com isso estara funcionando o thunder 2.2 no seu servidorCódigo :squid -k reconfigure
Grande abraço a todos, parabéns osmano pelas dicas, agora rodando Thunder 2.2 com limite de 2 videos para cada cliente (ip requisitante), recomendo a leitura do tópico no fórum do thundercache.org para melhor compreensão, obrigado Rodrigo Manga por ter compartilhado mais esta melhoria para o ThunderCache, Biazus por encabeçar o projeto e muito obrigado a todos os desenvolvedores que trabalham incansavelmente no aperfeiçoamento desta ferramenta.
E quando for lançado o ThunderCache 3, 4, 5, estaremos por aqui divulgando maneiras de facilitar a vida das pessoas, por enquanto a versão mais atualizada é a publicada acima. Este provavelmente seja uma versão intermediaria para o ThunderCache 3 em C.