How to determine which IP addresses are hitting your web site the most Ako zistiť, akú IP adresy sa biť vaše webové stránky najviac

by Ross McKillop on October 7, 2008 Ross McKillop dňa 7.října 2008

Bezpečnosť

This is a brief one. To je jeden krátky. Thanks to Vďaka The How-To Geek How-To Geek for bringing this command into my troubleshooting repertoire. pre uvedenie tohto príkazu do mojich problémov repertoáru.

A bit of background first. Trochu v pozadí ako prvý. This command is helpful to determine who is causing the most hits to your web site. Tento príkaz je užitočné zistiť, kto spôsobuje najväčšie hity na vaše webové stránky. On my music blog, I post a fair number of (totally legal) MP3s. Na môj hudobný blog, som po dostatočný počet (úplne legálne) MP3. Some less than ethical people often use those MP3s to stream via their site, causing mine to be slower (and a larger bandwidth bill). Niektoré menej ako etické ľudia často používajú tie MP3 do prúdu prostredníctvom svojich stránok, čo vedie dolu byť pomalší (a väčšiu šírku pásma zákona). 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. Výpočty, IP adresa webu / osobu "krádež" moje pásma potom môžem zablokovať ich IP v prístupe k niektorej z mojich obsahu.

Note: you'll need shell access to your web server log files Poznámka: musíte shell prístup na webový server log súborov

  1. SSH (or telnet) to your web host. SSH (alebo telnet) na vašom web serveri. Switch to the directory that stores your web server log files. Prepnite do adresára, ktorý ukladá vaše webové súborov protokolu servera.
  2. Run this command: Spustite tento príkaz:

    tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n chvost -100000 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. 100000, kde je počet riadkov (od konca súboru protokolu), ktorý chcete hľadať, a access.log je názov vášho prístupu web server prihlásiť.

  3. terminál s chvostom awk Uniq triediť výsledky

  4. The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most. Výsledkom bude (pravdepodobne) pomerne dlhý zoznam IP, zoradených podľa najmenej hity pre väčšinu. 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). Prvá hodnota v každom riadku je koľkokrát IP adresu (druhé číslo), prístup k webu (v počte riadkov súboru protokolu, ktorú ste zadali).

    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). Použitie počítača príkaz na určenie plne kvalifikovaný názov domény ľubovoľná IP adresa, ktorá ukazuje hore (budete chcieť vedieť, kto tie vaše stránky, ktoré postihli najviac sú). In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler. Vo snímky nižšie uvedenom príklade dvoch IP, ktoré postihli simplehelp.net väčšina z nich bola Googlebot a Yahoo stránok Crawler.

  5. terminál s chvostom awk Uniq triediť

  6. If there's an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command: Ak nie je IP / doméne, ktorá vyzerá podozrivo, si môžete skontrolovať, ktoré súbory boli klávesy pomocou príkazu:

    tail -1000 access.log | grep xx.xx.xx.xx chvost -1000 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. V tomto príkaze, 1000 je počet riadkov skontrolovať, access.log je názov vášho prístupu web server prihlásiť a xx.xx.xx.xx je IP, ktoré chcete vykonať zoradenie. 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. Já bych vám použiť menšie množstvo (1000 vs 100000, ako je použitý v prvom príkazu), pretože by ste asi nebudete potrebovať / chcieť vidieť každý súbor sú dostupné. If you do, increase the 1000 number. Ak tak urobíte, zvýšenie počtu 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. Alebo, ak nie je príliš veľa výsledkov ukáže, to znamená, že boli klávesy Vašu stránku "staršie", a budete chcieť zvýšiť 1000 to vyššie číslo.

Related Posts: Súvisiace zmeny:
  • Why you get email that isn't addressed to you Prečo ste si e-mail, že nie je určené pre vás
  • How to use vMailias to generate unique email addresses for easy sorting and filtering Ako používať vMailias vytvoriť unikátny e-mailovej adresy pre jednoduché triedenie a filtrovanie
  • How to secure your wireless home network Ako zabezpečiť Vašej bezdrôtovú domácu sieť
  • How to determine the number of times your site has been bookmarked on del.icou.us Ako zistiť, koľkokrát sa vaša stránka záložkou na del.icou.us
  • Joost Invites Joost vyzýva
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Get Help jednoduchá cvičenie, rovnako ako to vo vašej e-mailovej schránky každý deň - zadarmo! Just enter your email address below: Stačí zadať e-mailovú adresu:

    You can always opt out of this email subscription at any time. Vždy sa môžete odhlásiť z tohto e-mailu predplatného kedykoľvek.

    { 3 comments… read them below or (3 komentáre ... prečítať nižšie alebo add one pridať jedno } )

    1 1 Tony Tony 10.07.08 at 2:58 pm 10.07.08 v 258: pm

    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. Problém je, že keď niekto hotlinks vaše mp3 (alebo obrázky, alebo akékoľvek iné médium), potom je to stále IPs ich užívateľov, ktoré sa zobrazia v protokoloch, nie je trestné webserver. 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). To znamená, bude to pravdepodobne docela slušné rozloženie užívateľov a nerozoznanie od svojich legitímnych návštevníkov (ak niekto je jednoducho stále osviežujúci Váš mediálny obsah).

    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 chcete robiť, je kontrola informácií odkazujúcich na vaše mediálne súbory (samozrejme okrem svojej vlastnej doménu zo zoznamu).

    2 2 Ross Ross 10.07.08 at 3:05 pm 10.07.08 v 305: pm

    Tony – Tony --

    Under normal circumstances yes, you're absolutely right. Za normálnych okolností áno, máte úplnú pravdu. 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. V mojom konkrétnom prípade, že miesto bolo načítanie súborov cez flash player, aby hostila, a všetkých žiadostí pochádzalo z miest 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. Pridanie IP my. Htaccess potom zastavil Flash Player od zaťaženia piesne pre každého, / každého, kto sa snažil hrať je od * * explatives site.

    3 3 miiimooo 11.01.08 at 1:27 pm miiimooo 11.01.08 v 1:27 pm

    لم افهم شي لم افهم شي

    Leave a Comment Zanechať komentár

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Môžete použiť tieto HTML tagy a atribúty: href = "" <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> del datetime <em> <i> <q Cite=""> <strike> <strong>