The Ja-Jakarta ProjectTomcat Servlet/JSP コンテナ

リンク

ユーザガイド

リファレンス

Tomcat開発

Tomcat5 サーブレット/JSP コンテナ

CGI How To

CGI の手引き

Printer Friendly Version
印刷用
バージョン
Introduction
はじめに

The CGI (Common Gateway Interface) defines a way for a web server to interact with external content-generating programs, which are often referred to as CGI programs or CGI scripts.

CGI (Common Gateway Interface) は、 Web サーバが外部のコンテンツ生成プログラムとやりとりする方法を定義するもので、 コンテンツ生成プログラムはCGIプログラムやCGIスクリプトとも呼ばれます。

Within Tomcat CGI support can be added when using Tomcat as your HTTP server and you require CGI support. Typically this is done during development when you don't want to run a web server like Apache.

TomcatをHTTP サーバとして使っていて CGI 支援機能が必要になった場合には、 Tomcat に CGI 支援機能を加えることができます。Apache などの Webサーバを 使わずに開発する場合が典型的です。

CGI support is implemented using the servlet class org.apache.catalina.servlets.CGIServlet. Traditionally, this servlet is mapped to the URL pattern "/cgi-bin/*".

CGI 支援機能は org.apache.catalina.servlets.CGIServlet という サーブレットクラスを使って実装されています。従来このーブレットは、 "/cgi-bin/*"という URL パターンにマップされていました。

By default CGI support is disabled in Tomcat.

Tomcatのデフォルトでは、CGI 支援機能は無効になっています。

Installation
インストール

CAUTION - CGI scripts are used to execute programs external to the Tomcat JVM. If you are using the Java SecurityManager this will bypass your security policy configuration in catalina.policy.

注意 - CGI スクリプトは、Tomcat JVM の外部で動くプログラムを実行するために使われます。Java SecurityManagerを使っている場合、 catalina.policy.で設定されたセキュリティポリシーをこれらはかいくぐります。

Rename $CATALINA_BASE/server/lib/servlets-cgi.renametojar to $CATALINA_BASE/server/lib/servlets-cgi.jar.

$CATALINA_BASE/server/lib/servlets-cgi.renametojar$CATALINA_BASE/server/lib/servlets-cgi.jarに名前変更して下さい。

Remove the XML comments from around the CGI servlet and servlet-mapping configuration in $CATALINA_BASE/conf/web.xml.

$CATALINA_BASE/conf/web.xml の CGI サーブレットやサーブレットマッピング設定の周囲のXMLコメントを削除します。

Configuration
設定

There are several servlet init parameters which can be used to configure the behaviour of the CGI servlet.
  • cgiPathPrefix - The CGI search path will start at the web application root directory + File.separator + this prefix. The default cgiPathPrefix is /WEB-INF/cgi
  • clientInputTimeout - The time (in milliseconds) to wait for input from the browser before assuming that there is none. Default is 100 seconds.
  • debug - Debugging detail level for messages logged by this servlet. Default 0.

CGI サーブレットの動作を制御するためのサーブレット初期化パラメータがいくつかあります。

  • cgiPathPrefix - CGI を探すパスは、 Web アプリケーションのルートディレクトリと File.separator がこのプレフィクスの前についた形になる。 デフォルトの cgiPathPrefix は /WEB-INF/cgi
    [訳注: File.separatorとは、"/"や"\"などのディレクトリ記号のことです。]
  • clientInputTimeout - 何もないとみなすまでブラウザからの 入力を待つ時間(単位はミリ秒)。デフォルトは100秒。
  • debug - このサーブレットがログに残すメッセージのデバッグ詳細 レベル。デフォルトは 0。


[訳注: この文書は高橋達男が翻訳し、 田中良浩が校正しました。 日本語訳に対するコメントがあれば、report@jajakarta.orgに送って下さい。]
Copyright © 1999-2003, Apache Software Foundation