How to determine which IP addresses are hitting your web site the mostどのようにIPアドレスを特定するため、ほとんどのお客様のウェブサイトを殴っている

by Ross McKillop on October 7, 2008 ロス McKillop 2008年 10月 7日にで

セキュリティ

This is a brief one.これは短いものである。 Thanks toおかげで The How-To Geekオタクには、どのように for bringing this command into my troubleshooting repertoire.私のトラブルシューティングのレパートリーにこのコマンドをもたらしている。

A bit of background first.背景のビットが最初。 This command is helpful to determine who is causing the most hits to your web site.このコマンドは、 Webサイトを最も安打の原因となって決定するために役立ちます。 On my music blog, I post a fair number of (totally legal) MP3s.私の音楽のブログでは、私(完全に)公正な法律上の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).いくつかの倫理的な人未満のストリームにはしばしば自分のサイトを介して、鉱山の原因とそれらのMP3ファイルを使用する(そして、より大きな帯域幅の法案)を遅くする。 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.サイトのIPアドレス/人" "私は私のコンテンツにアクセスして任意のIPアドレスをブロックすることができます私の帯域幅を盗むを考え出す。

Note: you’ll need shell access to your web server log files 注:お客様のウェブサーバーのログファイルへのシェルアクセスが必要です

  1. SSH (or telnet) to your web host.お客様のウェブホストへのSSH (またはtelnet ) 。 Switch to the directory that stores your web server log files.は、ディレクトリに切り替えてWebサーバーのログファイルが格納されています。
  2. Run this command:このコマンドを実行します:

    tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n尾-100000 access.log | awkは' ( ) ' $ 1を印刷する|並べ替え| uniq - cを|ソート- Ñ

    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行数(ログファイルの末尾から)を検索するには、開始とaccess.logされているWebサーバーのアクセスログの名前です。

  3. 尾Awkのuniqソート結果を端末

  4. The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most.その結果、 (おそらく) IPアドレスのリストはかなり長い間、多くの人には少ない安打でソートされます。 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).各行の最初の値を倍のIPアドレス( 2番目の数字)の数は、ログを指定されたファイルの行数を( )にお客様のサイトにアクセスされています。

    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). ホストコマンドを使用して表示任意のIPアドレスの完全修飾ドメイン名を決定するために(おそらく、ほとんどの場合は、サイトヒットしたものを知って)いるかもしれません。 In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler.下のスクリーンショットの例では、 2つのsimplehelp.netヒットのIPアドレスの中で最もGooglebotが、ヤフーサイトのクローラされた。

  5. 尾Awkの端末uniqで並べ替え

  6. If there’s an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command:疑わしい点がある場合は、 IPアドレス/ドメインの場合、これは、コマンドを使用して打撃されたファイルを確認することができます:

    tail -1000 access.log | grep xx.xx.xx.xx尾-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.そのコマンドでは、 1000行の数を確認して、 access.logされている Webサーバーのアクセスログの名前を、 xx.xx.xx.xxは、 IPを基準に並べ替えるにしたいです。 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.私は小さい数字を使用して、おそらく必要はありません( 1000対100000として、最初のコマンドで使用) /ようお勧めするすべてのファイルを表示するには、 アクセスします。 If you do, increase the 1000 number.場合は、千数を増やすか。 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.また、非常に多くの結果をしていない場合は、そのユーザーがあなたのサイトは"以前の"打撃され、 1000年に高い数値に増加することを意味が表示されます。

Related Posts: 関連記事:
  • Why you get email that isn’t addressed to youなぜあなたは、あなたに対処されていない電子メールを取得
  • How to use vMailias to generate unique email addresses for easy sorting and filteringどのように簡単に並べ替えとフィルタリングの固有のメールアドレスを生成するためにvMailiasを使用するように
  • How to secure your wireless home networkどのようにあなたの無線ホームネットワークを確保する
  • How to transfer Outlook auto-complete addresses to a new computerどのように新しいコンピュータにOutlookのアドレスのオートコンプリートを転送する
  • Joost Invites Joostの招待
  • Get Simple Help tutorials just like this one in your email inbox every day - for free!お客様のメールの受信ボックスに毎日-無料で、この1つだけのような簡単なヘルプのチュートリアルを入手! Just enter your email address below:すぐ下にあなたのメールアドレスを入力してください:

    You can always opt out of this email subscription at any time.いつでも、いつでも、このメール購読のオプトアウトすることができます。


    Bookmark and Share ブックマークして共有する

    { 2 comments… read them below or 2以下のコメントを読む... add one 1つ追加 }

    1 1 Tony トニー 10.07.08 at 2:58 pm 10.07.08午後2時58分

    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.この問題は、誰かがあなたのMP3ファイル(または画像、または他のメディア) 、それが、自分たちのユーザーは、お客様のログに表示されるが 、 IPアドレスではなく、ウェブサーバーのは、不快なhotlinks 。 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).というのは、可能性は、お客様の正当な訪問者からのユーザーと区別できないのはかなり均等に分布されます(しない限りは継続)をメディアコンテンツをリフレッシュされています。

    What you want to be doing is checking for the referrer information to your media files (naturally excluding your own domain from the list).何をしたいのメディアファイルへの参照情報をチェックしています( 自然)のリストから自分のドメインを除くことをしている。

    2 2 Ross ロス 10.07.08 at 3:05 pm 10.07.08 3:05 pm

    Tony -トニー-

    Under normal circumstances yes, you’re absolutely right.はい、通常の状況下では、絶対に右にしています。 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.私の特定の場合には、このサイトは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.私の順番に。 htaccessを編集するには、 IPを追加する人のための曲の読み込みからは、 Flash Playerが停止/ explativesからは、 * *サイトを再生しようとした皆さん。

    Leave a Commentコメントを残しなさい

    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> これらのHTMLタグ属性:の<a href=""使用することができますtitle=""> <abbr title=""> <acronym title=""> <b>ダウンロード<blockquote cite=""> <cite>の<code> <del datetime="">の<em> <i> <q cite=""> <strike> <strong>