Apacheのログで416が大量に記録されていることに関する調査
2008 / 06 / 05 ( Thu )
Apacheのログ解析をしていたら、416が大量に記録されていることに気づいて調査。
416のステータスは
という事のようです。
調べると、ファイルの部分取得を行っているとこういうエラーが出るみたい。
telnet でテストする時には、Range: を使用します。
416のステータスは
416: Requested Range Not Satisfiable
実ファイルのサイズを超えるデータを要求した。
実ファイルのサイズを超えるデータを要求した。
という事のようです。
調べると、ファイルの部分取得を行っているとこういうエラーが出るみたい。
telnet でテストする時には、Range: を使用します。
通常のリクエストはこんな感じ。
Range を使うとこんな感じ。
Range: にいい加減な値を入れると、416が返ってきます。
このRangeは、ファイルダウンロードソフトが分割ダウンロードを行うときに使っているようです。
サーバー構築・運用に関わるプロフェッショナルの方々の体験談や解説がいっぱい集まった、
こちら↓のページも合わせてご参照ください。
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.1 200 OK
Date: Thu, 05 Jun 2008 14:46:20 GMT
Server: Apache/2.0.55 (Unix) PHP/4.4.4
Last-Modified: Wed, 08 Mar 2006 07:52:14 GMT
ETag: "224004-f-9bb2780"
Accept-Ranges: bytes
Content-Length: 15
Connection: close
Content-Type: text/html
<html>
</html>
Connection closed by foreign host.
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.1 200 OK
Date: Thu, 05 Jun 2008 14:46:20 GMT
Server: Apache/2.0.55 (Unix) PHP/4.4.4
Last-Modified: Wed, 08 Mar 2006 07:52:14 GMT
ETag: "224004-f-9bb2780"
Accept-Ranges: bytes
Content-Length: 15
Connection: close
Content-Type: text/html
<html>
</html>
Connection closed by foreign host.
Range を使うとこんな感じ。
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Range: bytes=2- ← ここを追加。
HTTP/1.1 206 Partial Content
Date: Thu, 05 Jun 2008 14:48:28 GMT
Server: Apache/2.0.55 (Unix) PHP/4.4.4
Last-Modified: Wed, 08 Mar 2006 07:52:14 GMT
ETag: "224004-f-9bb2780"
Accept-Ranges: bytes
Content-Length: 13
Content-Range: bytes 2-14/15
Connection: close
Content-Type: text/html
tml> ← <h が飛ばされて表示。
</html>
Connection closed by foreign host.
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Range: bytes=2- ← ここを追加。
HTTP/1.1 206 Partial Content
Date: Thu, 05 Jun 2008 14:48:28 GMT
Server: Apache/2.0.55 (Unix) PHP/4.4.4
Last-Modified: Wed, 08 Mar 2006 07:52:14 GMT
ETag: "224004-f-9bb2780"
Accept-Ranges: bytes
Content-Length: 13
Content-Range: bytes 2-14/15
Connection: close
Content-Type: text/html
tml> ← <h が飛ばされて表示。
</html>
Connection closed by foreign host.
Range: にいい加減な値を入れると、416が返ってきます。
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Range: bytes=100- ← 適当に大きい数字を入れると…
HTTP/1.1 416 Requested Range Not Satisfiable
Date: Thu, 05 Jun 2008 14:51:40 GMT
Server: Apache/2.0.55 (Unix) PHP/4.4.4
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>416 Requested Range Not Satisfiable</title>
</head><body>
<h1>Requested Range Not Satisfiable</h1>
<p>None of the range-specifier values in the Range
request-header field overlap the current extent
of the selected resource.</p>
<hr>
<address>Apache/2.0.55 (Unix) PHP/4.4.4 Server at www.example.com Port 80</address>
</body></html>
Connection closed by foreign host.
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Range: bytes=100- ← 適当に大きい数字を入れると…
HTTP/1.1 416 Requested Range Not Satisfiable
Date: Thu, 05 Jun 2008 14:51:40 GMT
Server: Apache/2.0.55 (Unix) PHP/4.4.4
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>416 Requested Range Not Satisfiable</title>
</head><body>
<h1>Requested Range Not Satisfiable</h1>
<p>None of the range-specifier values in the Range
request-header field overlap the current extent
of the selected resource.</p>
<hr>
<address>Apache/2.0.55 (Unix) PHP/4.4.4 Server at www.example.com Port 80</address>
</body></html>
Connection closed by foreign host.
このRangeは、ファイルダウンロードソフトが分割ダウンロードを行うときに使っているようです。
サーバー構築・運用に関わるプロフェッショナルの方々の体験談や解説がいっぱい集まった、
こちら↓のページも合わせてご参照ください。
| ホーム |



