From: Yoshiki Hayashi Date: Thu, 30 May 2002 07:27:50 +0000 (+0000) Subject: New Japanese translation. Forward port from 1.3. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fc7f9755cff732bd98d29df256c1051ee0ca86e;p=apache New Japanese translation. Forward port from 1.3. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95393 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/cgi_path.html b/docs/manual/cgi_path.html deleted file mode 100644 index 4ed74ade20..0000000000 --- a/docs/manual/cgi_path.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - PATH_INFO Changes in the CGI Environment - - - - - - -

PATH_INFO Changes in the CGI - Environment

-
- -

Overview

- -

As implemented in Apache 1.1.1 and earlier versions, the - method Apache used to create PATH_INFO in the CGI environment - was counterintuitive, and could result in crashes in certain - cases. In Apache 1.2 and beyond, this behavior has changed. - Although this results in some compatibility problems with - certain legacy CGI applications, the Apache 1.2 behavior is - still compatible with the CGI/1.1 specification, and CGI - scripts can be easily modified (see - below).

- -

The Problem

- -

Apache 1.1.1 and earlier implemented the PATH_INFO and - SCRIPT_NAME environment variables by looking at the filename, - not the URL. While this resulted in the correct values in many - cases, when the filesystem path was overloaded to contain path - information, it could result in errant behavior. For example, - if the following appeared in a config file:

-
-     Alias /cgi-ralph /usr/local/httpd/cgi-bin/user.cgi/ralph
-
- -

In this case, user.cgi is the CGI script, the - "/ralph" is information to be passed onto the CGI. If this - configuration was in place, and a request came for - "/cgi-ralph/script/", the code would set PATH_INFO - to "/ralph/script", and SCRIPT_NAME to - "/cgi-". Obviously, the latter is incorrect. In - certain cases, this could even cause the server to crash.

- -

The Solution

- -

Apache 1.2 and later now determine SCRIPT_NAME and PATH_INFO - by looking directly at the URL, and determining how much of the - URL is client-modifiable, and setting PATH_INFO to it. To use - the above example, PATH_INFO would be set to - "/script", and SCRIPT_NAME to - "/cgi-ralph". This makes sense and results in no - server behavior problems. It also permits the script to be - guaranteed that - "http://$SERVER_NAME:$SERVER_PORT$SCRIPT_NAME$PATH_INFO" - will always be an accessible URL that points to the current - script, something which was not necessarily true with previous - versions of Apache.

- -

However, the "/ralph" information from the - Alias directive is lost. This is unfortunate, but - we feel that using the filesystem to pass along this sort of - information is not a recommended method, and a script making - use of it "deserves" not to work. Apache 1.2b3 and later, - however, do provide a workaround.

- -

Compatibility with Previous - Servers

- -

It may be necessary for a script that was designed for - earlier versions of Apache or other servers to need the - information that the old PATH_INFO variable provided. For this - purpose, Apache 1.2 (1.2b3 and later) sets an additional - variable, FILEPATH_INFO. This environment variable contains the - value that PATH_INFO would have had with Apache 1.1.1.

- -

A script that wishes to work with both Apache 1.2 and - earlier versions can simply test for the existence of - FILEPATH_INFO, and use it if available. Otherwise, it can use - PATH_INFO. For example, in Perl, one might use:

-
-    $path_info = $ENV{'FILEPATH_INFO'} || $ENV{'PATH_INFO'};
-
- -

By doing this, a script can work with all servers supporting - the CGI/1.1 specification, including all versions of - Apache.

- - - - diff --git a/docs/manual/cgi_path.html.ja.jis b/docs/manual/cgi_path.html.ja.jis new file mode 100644 index 0000000000..91c0364e7a --- /dev/null +++ b/docs/manual/cgi_path.html.ja.jis @@ -0,0 +1,98 @@ + + + + + + CGI 環境の PATH_INFO の変更 + + + + + + + +

CGI 環境の PATH_INFO の変更

+
+ + +

概要

+ +

Apache 1.1.1 およびそれ以前のバージョンで実装されていた + CGI 環境で PATH_INFO を作成する方法は直観的でなく、 + 場合によってはクラッシュすることもありました。 + Apache 1.2 及びそれ以降において、この動作が変更されました。 + このことにより特定の古い CGI アプリケーションにおいていくつか + 互換性の問題が生じることがありますが、それでも Apache 1.2 の動作は + CGI/1.1 仕様と互換があり、CGI スクリプトは容易に修正できます(以下参照)。

+ +

問題

+ +

Apache 1.1.1 およびそれ以前では、URL ではなくファイル名を参照して + PATH_INFO と SCRIPT_NAME 環境変数を設定していました。 + 多くの場合はこれが正しい結果を返しますが、パス情報を含むように + filesystem パスがオーバーロードされた場合は、 + 誤った結果を返す場合がありました。 + たとえば、設定ファイルに以下がある場合

+
+     Alias /cgi-ralph /usr/local/httpd/cgi-bin/user.cgi/ralph
+
+ +

この場合、user.cgi は CGI スクリプトであり、 + "/ralph" は、CGI に渡される情報です。もし上の設定がなされていて、 + "/cgi-ralph/script/" へのリクエストが来れば、 + PATH_INFO には "/ralph/script/" が、 + SCRIPT_NAME には "/cgi-" が設定されます。 + 明らかに、後者は間違っています。特定の場合には、これにより + サーバがクラッシュすることさえありました。

+ +

解決

+ +

Apache 1.2 以降では SCRIPT_NAME と PATH_INFO の決定には URL + を直接参照して、URL + のどれだけの部分がクライアントが変更可能なのかを確定させた上で + PATH_INFO を設定するようになりました。上の例では、PATH_INFO には + "/script" が、SCRIPT_NAME には + "/cgi-ralph" が設定されます。 + これは正しく、さらに、サーバの動作に問題を起こすこともありません。また、 + "http://$SERVER_NAME:$SERVER_PORT$SCRIPT_NAME$PATH_INFO" + が、常に最新のスクリプトを指す、アクセス可能な URL であることを + 保証します。これは、以前のバージョンの Apache + では必ずしもそうとは限らなかったことです。 +

+ +

しかし Alias ディレクティブからの + "/ralph" 情報は失われます。 + これは残念ですが、filesystem を通してこの種類の情報を + 渡すのは薦められた方法ではなく、 + またそれを使ったスクリプトは動作しなくても当然だと考えます。 + ただし、Apache 1.2b3 以降では代替手段を用意しています。

+ +

以前のサーバとの互換性

+ +

以前のバージョンの Apache や他のサーバ向けに設計された + スクリプトには古い PATH_INFO 変数により提供される情報が + 必要であるかもしれません。 + この目的のために、 + Apache 1.2 (1.2b3 以降) では追加の変数、FILEPATH_INFO + を設定します。この環境変数には、Apache 1.1.1 で + PATH_INFO であったであろう値が設定されます。

+ +

Apache 1.2 およびそれ以前のバージョンの両方で動作させたいスクリプトは、 + FILEPATH_INFO の存在を単に調べて、それがあれば + 使う、ということができます。そうでなければ、PATH_INFO + を使うことができます。たとえば、Perl では次のものを使うことができます

+
+    $path_info = $ENV{'FILEPATH_INFO'} || $ENV{'PATH_INFO'};
+
+ +

これにより、スクリプトはすべてのバージョンの Apache を含む、 + CGI/1.1 をサポートするすべてのサーバで動作することができます。 +

+ + + + diff --git a/docs/manual/custom-error.html b/docs/manual/custom-error.html deleted file mode 100644 index 3cbb570436..0000000000 --- a/docs/manual/custom-error.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - Custom error responses - - - - - - -

Custom error responses

- -
-
Purpose
- -
- Additional functionality. Allows webmasters to configure - the response of Apache to some error or problem. - -

Customizable responses can be defined to be activated in - the event of a server detected error or problem.

- -

e.g. if a script crashes and produces a "500 Server - Error" response, then this response can be replaced with - either some friendlier text or by a redirection to another - URL (local or external).

-
- -
Old behavior
- -
NCSA httpd 1.3 would return some boring old error/problem - message which would often be meaningless to the user, and - would provide no means of logging the symptoms which caused - it.
-
- -
New behavior
- -
- The server can be asked to; - -
    -
  1. Display some other text, instead of the NCSA hard - coded messages, or
  2. - -
  3. redirect to a local URL, or
  4. - -
  5. redirect to an external URL.
  6. -
- -

Redirecting to another URL can be useful, but only if - some information can be passed which can then be used to - explain and/or log the error/problem more clearly.

- -

To achieve this, Apache will define new CGI-like - environment variables, e.g.

- -
- REDIRECT_HTTP_ACCEPT=*/*, image/gif, - image/x-xbitmap, image/jpeg
- REDIRECT_HTTP_USER_AGENT=Mozilla/1.1b2 (X11; I; HP-UX - A.09.05 9000/712)
- REDIRECT_PATH=.:/bin:/usr/local/bin:/etc
- REDIRECT_QUERY_STRING=
- REDIRECT_REMOTE_ADDR=121.345.78.123
- REDIRECT_REMOTE_HOST=ooh.ahhh.com
- REDIRECT_SERVER_NAME=crash.bang.edu
- REDIRECT_SERVER_PORT=80
- REDIRECT_SERVER_SOFTWARE=Apache/0.8.15
- REDIRECT_URL=/cgi-bin/buggy.pl
-
-
- -

note the REDIRECT_ prefix.

- -

At least REDIRECT_URL and - REDIRECT_QUERY_STRING will be passed to the - new URL (assuming it's a cgi-script or a cgi-include). The - other variables will exist only if they existed prior to - the error/problem. None of these will be - set if your ErrorDocument is an external redirect - (i.e., anything starting with a scheme name like - http:, even if it refers to the same host as - the server).

-
- -
Configuration
- -
- Use of "ErrorDocument" is enabled for .htaccess files when - the "FileInfo" - override is allowed. - -

Here are some examples...

- -
- ErrorDocument 500 /cgi-bin/crash-recover
- ErrorDocument 500 "Sorry, our script crashed. Oh - dear
- ErrorDocument 500 http://xxx/
- ErrorDocument 404 /Lame_excuses/not_found.html
- ErrorDocument 401 - /Subscription/how_to_subscribe.html
-
- -

The syntax is,

- -

ErrorDocument - <3-digit-code> action

- -

where the action can be,

- -
    -
  1. Text to be displayed. Prefix the text with a quote - ("). Whatever follows the quote is displayed. Note: - the (") prefix isn't displayed.
  2. - -
  3. An external URL to redirect to.
  4. - -
  5. A local URL to redirect to.
  6. -
-
-
-
- -

Custom error responses and redirects

- -
-
Purpose
- -
Apache's behavior to redirected URLs has been modified so - that additional environment variables are available to a - script/server-include.
- -
Old behavior
- -
Standard CGI vars were made available to a script which - has been redirected to. No indication of where the - redirection came from was provided.
- -
New behavior
- -
A new batch of environment variables will be initialized - for use by a script which has been redirected to. Each new - variable will have the prefix REDIRECT_. - REDIRECT_ environment variables are created from - the CGI environment variables which existed prior to the - redirect, they are renamed with a REDIRECT_ - prefix, i.e., HTTP_USER_AGENT becomes - REDIRECT_HTTP_USER_AGENT. In addition to these - new variables, Apache will define REDIRECT_URL - and REDIRECT_STATUS to help the script trace its - origin. Both the original URL and the URL being redirected to - can be logged in the access log.
-
- -

If the ErrorDocument specifies a local redirect to a CGI - script, the script should include a "Status:" - header field in its output in order to ensure the propagation - all the way back to the client of the error condition that - caused it to be invoked. For instance, a Perl ErrorDocument - script might include the following:

-
-      :
-    print  "Content-type: text/html\n";
-    printf "Status: %s Condition Intercepted\n", $ENV{"REDIRECT_STATUS"};
-      :
-
- -

If the script is dedicated to handling a particular error - condition, such as 404 Not Found, it can - use the specific code and error text instead.

- - - - diff --git a/docs/manual/custom-error.html.ja.jis b/docs/manual/custom-error.html.ja.jis new file mode 100644 index 0000000000..b4610c51b1 --- /dev/null +++ b/docs/manual/custom-error.html.ja.jis @@ -0,0 +1,183 @@ + + + + + + + カスタムエラーレスポンス + + + + + + + +

カスタムエラーレスポンス

+ +
+
目的
+ +
+ 追加機能の提供。ウェブマスターが何らかのエラーや問題に対する + Apache の反応を設定できるようにします。 + +

サーバがエラーや問題を発見した場合の反応を、 + カスタマイズして定義することができます。

+ +

例えば、スクリプトの実行が失敗して "500 Server Error" + を発生させたとします。この場合の反応を、より好ましいテキストや、別の + URL (内部及び外部) へのリダイレクションに置き換えることができます。 +

+
+ +
古い動作
+ +
NCSA httpd 1.3 は、古くて退屈なエラー/問題メッセージを + 返していました。それはしばしばユーザには無意味であり、 + またそれを発生させた原因を記録する方法も提供していませんでした。 +
+
+ +
新しい動作
+ +
+ + +
    +
  1. NCSA のハードコードされたメッセージの代わりに + 他のテキストを表示
  2. + +
  3. ローカルの URL にリダイレクト
  4. + +
  5. 外部の URL にリダイレクト
  6. +
+ するようにサーバを設定できます。 +

別の URL にリダイレクトすることは役に立ちますが、 + それは説明をしたり、より明確に誤り/問題を記録したりするために + 何か情報を伝えられるときに限ります。

+ +

これを実現するために、 Apache は新しく CGI のような環境変数を定義します。 + 例えば以下のようなものがあります。

+ +
+ REDIRECT_HTTP_ACCEPT=*/*, image/gif, + image/x-xbitmap, image/jpeg
+ REDIRECT_HTTP_USER_AGENT=Mozilla/1.1b2 (X11; I; HP-UX + A.09.05 9000/712)
+ REDIRECT_PATH=.:/bin:/usr/local/bin:/etc
+ REDIRECT_QUERY_STRING=
+ REDIRECT_REMOTE_ADDR=121.345.78.123
+ REDIRECT_REMOTE_HOST=ooh.ahhh.com
+ REDIRECT_SERVER_NAME=crash.bang.edu
+ REDIRECT_SERVER_PORT=80
+ REDIRECT_SERVER_SOFTWARE=Apache/0.8.15
+ REDIRECT_URL=/cgi-bin/buggy.pl
+
+
+ +

頭に付く REDIRECT_ に注目してください。

+ +

少なくとも REDIRECT_URL と + REDIRECT_QUERY_STRING は新しい URL (CGI スクリプトか + CGI インクルードであると仮定されます) に渡されます。 + 他の変数は、エラーや問題が起きる前に存在した場合にだけ存在します。 + もしあなたの設定した ErrorDocument が 外部リダイレクト + (すなわちhttp: + のような体系名から始まるすべてのもの。たとえ同じホストを指していても) + ならば、これらはまったく設定されません。 +

+
+ +
設定
+ +
+ "FileInfo" オーバーライド + が許可されていれば、.htaccess ファイルで "ErrorDocument" + を使用することができます。 + +

ここに、いくつかの例を挙げます。

+ +
+ ErrorDocument 500 /cgi-bin/crash-recover
+ ErrorDocument 500 "Sorry, our script crashed. Oh + dear
+ ErrorDocument 500 http://xxx/
+ ErrorDocument 404 /Lame_excuses/not_found.html
+ ErrorDocument 401 + /Subscription/how_to_subscribe.html
+
+ +

構文

+ +

ErrorDocument + <3 桁コード> 動作

+ +

動作は、

+ +
    +
  1. 表示されるべきテキスト。テキストには引用符 (") をつけます。 + 引用符の後に続くものが何でも表示されます。 + 注意 : (") は表示されません
  2. + +
  3. リダイレクト先の外部 URL
  4. + +
  5. リダイレクト先のローカル URL
  6. +
+
+
+
+ +

カスタムエラーレスポンスとリダイレクト

+ +
+
目的
+ +
スクリプト/SSI に追加の環境変数が利用可能になるように、 + リダイレクトされた URL に対する Apache の動作が変更されました。 +
+ +
古い動作
+ +
リダイレクトされたスクリプトは標準の CGI + 環境変数を利用可能でした。しかし、どこからリダイレクト + されたかの情報は提供されていませんでした。
+ +
新しい動作
+ +
リダイレクトされた先のスクリプトが使用可能なように、 + 新しいたくさんの環境変数が初期化されます。新しい変数は、それぞれ + REDIRECT_ で始まります。 + REDIRECT_ で始まる環境変数はリダイレクトされる前に存在していた + CGI 環境変数の頭に REDIRECT_ を付けて作成されます。 + すなわちHTTP_USER_AGENT は + REDIRECT_HTTP_USER_AGENT になります。 + これらの新しい変数に加えて、Apache は、 + スクリプトがリダイレクト元のトレースを助けるために + REDIRECT_URLREDIRECT_STATUS + を定義します。アクセスログには元の URL とリダイレクトされた URL + の両方が記録されます。
+
+ +

ErrorDocument が CGI スクリプトへのローカルリダイレクトを + 指定している場合は、それを起動することになったエラーの状態を + クライアントまで確実に伝えるために "Status:" + ヘッダを含むべきです。例えば、ErrorDocument 用の Perl + スクリプトは以下のようなものを含むかもしれません。 +

+
+      :
+    print  "Content-type: text/html\n";
+    printf "Status: %s Condition Intercepted\n", $ENV{"REDIRECT_STATUS"};
+      :
+
+ +

スクリプトが 404 Not Found のような + 特定のエラーコンディションを扱うためだけに使われる場合は、 + 代わりに特定のコードとエラーテキストを使用することができます。 +

+ + +