This is a brief one. Esta é uma breve um. Thanks to Graças a The How-To Geek O how-to geek for bringing this command into my troubleshooting repertoire. por trazer esse comando para solucionar problemas em meu repertório.
A bit of background first. Um pouco de fundo primeiro. This command is helpful to determine who is causing the most hits to your web site. Este comando é útil para determinar quem está causando a maioria dos acessos ao seu site. On my music blog, I post a fair number of (totally legal) MP3s. Blog sobre minha música, eu anunciar um equitativo número de (totalmente legal) MP3s. Some less than ethical people often use those MP3s to stream via their site, causing mine to be slower (and a larger bandwidth bill). Algumas pessoas menos éticas frequentemente utilizam esses MP3s ao fluxo através dos sites, causando mina a ser mais lento (e uma maior banda bill). By figuring out the IP address of the site/person “stealing” my bandwidth I can then block their IP from accessing any of my content. Por Descobrir o endereço IP do site / pessoa "roubando" a minha banda, então eu posso bloquear seu IP de acessar qualquer conteúdo do meu.
Note: you’ll need shell access to your web server log files Observação: você terá acesso ao shell seu servidor web log
- SSH (or telnet) to your web host. SSH (ou telnet) para o seu host. Switch to the directory that stores your web server log files. Mude para o diretório que armazena o servidor web arquivos de log.
- Run this command: Execute este comando:
tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n cauda -100.000 access.log | awk '(print $ 1)' | sort | uniq-c | sort-n
where 100000 is the number of lines (starting from the end of the log file) you want to search, and access.log is the name of your web server access log. onde 100000 é o número de linhas (a partir do final do arquivo de log) que deseja pesquisar, e access.log é o nome do seu servidor web log acesso.
- The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most. O resultado será um (provavelmente) bastante longa lista de IPs, ordenadas pelo menos a maior parte dos acessos. The first value in each row is the number of times the IP address (the second number) accessed your site (in the number of lines of the log file you specified). O primeiro valor em cada linha é o número de vezes que o endereço IP (o segundo número) acessar o site (no número de linhas do arquivo de log que você especificou).
Use the host command to determine the fully qualified domain name of any IP address that shows up (you’ll probably want to know who the ones that hit your site the most are). Use o comando host para determinar o nome de domínio totalmente qualificado de um endereço IP que apareceu (você provavelmente vai querer saber quem os que atingiram o seu site são mais). In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler. Na tela exemplo a seguir, dois dos IPs que foram as mais atingidas simplehelp.net o Googlebot e Yahoo Site do rastreador.
- If there’s an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command: Se há um IP / domínio que pareça suspeito, você pode verificar para ver quais arquivos que estavam batendo, usando o comando:
tail -1000 access.log | grep xx.xx.xx.xx cauda -1.000 access.log | grep xx.xx.xx.xx
In that command, 1000 is the number of lines to check, access.log is the name of your web server access log, and xx.xx.xx.xx is the IP you want to sort by. Nesse comando, 1000 é o número de linhas para verificar, access.log é o nome do seu servidor web log acesso, e xx.xx.xx.xx é o IP que você deseja classificar. I’d suggest using a smaller number (1000 vs. 100000 as used in the first command) as you probably don’t need/want to see every file they accessed. Eu ia sugerir usar um número menor (1000 vs 100000 utilizados como no primeiro comando), como você provavelmente não precisará / quero ver todos os arquivos acessados eles. If you do, increase the 1000 number. Se fizer isso, aumentar o número 1000. Or, if not very many results show up, that means that they were hitting your site “earlier”, and you’ll want to increase 1000 to a higher number. Ou, se não aparecer muitos resultados, isso significa que eles estavam batendo o seu site "mais cedo", e você vai querer aumentar um número superior a 1000.
























{ 2 comments… read them below or (2 comentários abaixo ou lê-las ... add one adicionar um } )
The problem is that if someone hotlinks your mp3s (or images, or any other media), then it’s still the IPs of their users that will show up in your logs, not the offending webserver. O problema é que, se alguém Ligação Directa seus MP3s (ou imagens, ou quaisquer outros meios de comunicação social), então ela ainda os IPs dos seus usuários de que vai aparecer em seus registros, e não ofender o servidor web. That is to say, it will likely be a fairly even distribution of users and indistinguishable from that of your legitimate visitors (unless someone is just continuously refreshing your media content). Esse é o dizer, ele provavelmente vai ser uma justa distribuição uniforme dos utilizadores e que a distingue de seus legítimos dos visitantes (a não ser que alguém está a apenas renovando continuamente o seu conteúdo multimédia).
What you want to be doing is checking for the referrer information to your media files (naturally excluding your own domain from the list). O que você quer fazer é verificar se há a informação referente aos seus ficheiros multimédia (excluindo naturalmente o seu próprio domínio na lista).
Tony - Tony --
Under normal circumstances yes, you’re absolutely right. Em circunstâncias normais, sim, você está absolutamente certo. In my specific case, the site was loading the files via a flash player that they hosted, and all the requests came from the sites flash player. No meu caso específico, o site estava carregando os arquivos através de um flash player que se hospedado, e os pedidos vieram de todos os sites flash player. Adding the IP to my .htaccess in turn stopped the flash player from loading the songs for anyone/everyone who tried to play them from the *explatives* site. Adicionando o IP para o meu. Htaccess, por sua vez, parou o carregamento do flash player de músicas para ninguém / todo mundo que tentou jogá-los a partir do site * * explatives.
Leave a Comment Deixe um comentário