How to determine which IP addresses are hitting your web site the most Wie um zu bestimmen, welche IP-Adressen sind Schlagen Sie Ihre Web-Site können Sie die meisten

by Ross McKillop on October 7, 2008 von Ross McKillop am 7. Oktober 2008

Security

This is a brief one. Dies ist eine kurze ein. Thanks to Dank The How-To Geek Das How-To Geek for bringing this command into my troubleshooting repertoire. , um diesen Befehl in mein Repertoire Fehlerbehebung.

A bit of background first. Ein bisschen Hintergrund ersten. This command is helpful to determine who is causing the most hits to your web site. Dieser Befehl ist hilfreich, um festzulegen, wer was die meisten Treffer zu Ihrer Web-Site. On my music blog, I post a fair number of (totally legal) MP3s. Auf meine Musik Blog, ich eine faire Anzahl der (völlig legale) 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). Einige weniger als ethische Menschen oft diese MP3s zum Streamen über ihre Website, was mir zu langsamer (und eine größere Bandbreite Rechnung). 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. Mit herauszufinden, die IP-Adresse der Website / Person "stehlen" meine Bandbreite kann ich dann ihre IP-Block aus Zugriff auf jede meiner Inhalte.

Note: you’ll need shell access to your web server log files Hinweis: Sie müssen Shell-Zugriff auf Ihre Web-Server Log-Dateien

  1. SSH (or telnet) to your web host. SSH (oder telnet) auf Ihren Web-Host. Switch to the directory that stores your web server log files. Wechseln Sie in das Verzeichnis, dass speichert Ihre Web-Server Log-Dateien.
  2. Run this command: Führen Sie diesen Befehl aus:

    tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n -100.000 Heck 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 wo ist die Anzahl der Zeilen (beginnend mit dem Ende der Log-Datei) Sie suchen möchten, und access.log ist der Name Ihres Web-Server-Zugriff anmelden.

  3. Terminal mit Schwanz awk uniq Ergebnisse sortieren

  4. The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most. Das Ergebnis wird eine (wahrscheinlich) ziemlich lange Liste von IP-Adressen, sortiert nach wenigen Treffern für die meisten. 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). Der erste Wert in jeder Zeile ist die Zahl der mal die IP-Adresse (die zweite Zahl) Zugriff auf Ihre Website (in der Anzahl der Zeilen der Log-Datei, die Sie angegeben).

    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). Verwenden Sie die Host-Befehl, um festzustellen, der Fully Qualified Domain-Name einer IP-Adresse, zeigt sich (Sie wahrscheinlich wissen wollen, wer diejenigen, die Hit Ihrer Website die meisten sind). In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler. In den Screenshot Beispiel unten, zwei der IPs, dass Hit simplehelp.net die meisten waren Googlebot und der Yahoo Site Crawler.

  5. Terminal mit Schwanz awk uniq Art

  6. If there’s an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command: Wenn es ein IP / Domain, die verdächtig aussieht, können Sie überprüfen, um zu sehen, welche Dateien sie sich treffen, indem Sie den folgenden Befehl ein:

    tail -1000 access.log | grep xx.xx.xx.xx Schwanz -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. In diesem Befehl, 1000 ist die Anzahl der Zeilen zu überprüfen, access.log ist der Name Ihres Web-Server Log-Zugang, und xx.xx.xx.xx ist die IP-Sie wollen, geordnet nach. 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. Ich würde empfehlen die Verwendung einer kleineren Zahl (1000 vs 100.000, die sich in den ersten Befehl), wie Sie wahrscheinlich nicht brauchen / wollen, um zu sehen, jede Datei sie zugegriffen. If you do, increase the 1000 number. Wenn Sie dies tun, um die 1000-Nummer. 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. Oder, wenn nicht sehr viele Ergebnisse angezeigt, das bedeutet, dass sie sich treffen Ihrer Website "früher", und Sie erhöhen wollen 1000 auf eine höhere Anzahl.

Related Posts: Verwandte Einträge:
  • Why you get email that isn’t addressed to you Warum erhalten Sie E-Mail, die nicht an Sie gerichtet
  • How to use vMailias to generate unique email addresses for easy sorting and filtering So verwenden Sie vMailias zu generieren einzigartige E-Mail-Adressen für die einfache Sortierung und Filterung
  • How to secure your wireless home network Wie, um Ihre Wireless-Netzwerk zu Hause
  • How to transfer Outlook auto-complete addresses to a new computer Wie die Übertragung von Outlook die automatische Vervollständigung, Adressen auf einen neuen Computer
  • Joost Invites Joost bittet
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Holen Sie sich Einfache Hilfe Tutorials wie diese ein in Ihrem E-Mail-Posteingang jeden Tag - gratis! Just enter your email address below: Geben Sie einfach Ihre E-Mail-Adresse unten ein:

    You can always opt out of this email subscription at any time. Sie können immer Opt-out in dieser E-Mail-Abonnement zu jeder Zeit.


    Bookmark and Share Lesezeichen und Aktie

    { 2 comments… read them below or (2 Kommentare ... lesen sie unten oder add one Hinzufügen ein } )

    1 1 Tony Tony 10.07.08 at 2:58 pm 10.07.08 bei 2:58 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. Das Problem ist, dass, wenn jemand Hotlinks Ihre MP3s (oder Bilder oder andere Medien), dann ist es immer noch die IP-Adressen der Nutzer, die zeigen, in Ihrem Protokolle, nicht der säumige 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). Das heißt, es wird wahrscheinlich eine recht gleichmäßige Verteilung der Benutzer und nicht von der Ihrer berechtigten Besucher (es sei denn, jemand ist nur ständig erfrischende Ihre Medieninhalte).

    What you want to be doing is checking for the referrer information to your media files (naturally excluding your own domain from the list). Was Sie wollen, zu tun, ist die Überprüfung für Referrer die Informationen an Ihre Medien-Dateien (natürlich ohne Ihre eigene Domain aus der Liste).

    2 2 Ross Ross 10.07.08 at 3:05 pm 10.07.08 bei 3:05 pm

    Tony - Tony --

    Under normal circumstances yes, you’re absolutely right. Unter normalen Umständen ja, sind Sie völlig Recht. 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. In meinem speziellen Fall, die Website wurde das Laden der Dateien über einen Flash Player, dass sie gehostet werden, und alle Anträge kamen aus den Standorten 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. Hinzufügen der IP-Adresse zu meinem. Htaccess in gestoppt wiederum den Flash Player geladen wird die Songs für jeden / jeder, der versucht habe, sie aus dem explatives * * Website.

    Leave a Comment Schreibe einen Kommentar

    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> Sie können diese HTML-Tags und Attribute: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>