<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="manager-howto.html">

    &project;

    <properties>
        <author email="craigmcc@apache.org">Craig R. McClanahan</author>
        <primary><title>Manager App HOW-TO</title></primary>
        <title>Managerアプリケーションの手引き</title>
        <translator>高橋達男</translator>
    </properties>

<body>

<primary>
<section name="Table of Contents"/>
</primary>
<section name="目次">

<p>
<primary>
<a href="#Introduction">Introduction</a><br />
</primary>
<a href="#はじめに">はじめに</a><br />
<primary>
<a href="#Configuring Manager Application Access">
Configuring Manager Application Access</a><br />
</primary>
<a href="#Managerアプリケーションへのアクセス設定">
Managerアプリケーションへのアクセス設定</a><br />
<primary>
<a href="#Supported Manager Commands">Supported Manager Commands</a><br />
</primary>
<a href="#サポートされるManagerコマンド">サポートされるManagerコマンド</a><br />
<primary>
<blockquote>
<a href="#Deploy A New Application Remotely">Deploy A New Application Remotely</a><br />
<a href="#Deploy A New Application from a Local Path">Deploy A New Application from a Local Path</a><br />
<a href="#List Currently Deployed and Installed Applications">
List Currently Deployed and Installed Applications</a><br />
<a href="#Reload An Existing Application">Reload An Existing Application</a><br />
<a href="#List OS and JVM Properties">List OS and JVM Properties</a><br />
<a href="#List Available Global JNDI Resources">
List Available Global JNDI Resources</a><br />
<a href="#List Available Security Roles">List Available Security Roles</a><br />
<a href="#Session Statistics">Session Statistics</a><br />
<a href="#Start an Existing Application">Start an Existing Application</a><br />
<a href="#Stop an Existing Application">Stop an Existing Application</a><br />
<a href="#Undeploy an Existing Application">
Undeploy an Existing Application</a><br />
</blockquote>
</primary>
<blockquote>
<a href="#リモートへの新しいアプリケーションの配備">リモートへの新しいアプリケーションの配備</a><br />
<a href="#Deploy A New Application from a Local Path">ローカルパスからの新しいアプリケーションの配備</a><br />
<a href="#配備・インストール済のアプリケーションの一覧表示">
配備・インストール済のアプリケーションの一覧表示</a><br />
<a href="#既存のアプリケーションの再ロード">既存のアプリケーションの再ロード</a><br />
<a href="#OS・JVMのプロパティの一覧表示">OS・JVMのプロパティの一覧表示</a><br />
<a href="#利用可能なJNDIリソースの一覧表示">
利用可能なJNDIリソースの一覧表示</a><br />
<a href="#利用可能なセキュリティロールの一覧表示">利用可能なセキュリティロールの一覧表示</a><br />
<a href="#セッション統計">セッション統計</a><br />
<a href="#既存のアプリケーションの起動">既存のアプリケーションの起動</a><br />
<a href="#既存のアプリケーションの停止">既存のアプリケーションの停止</a><br />
<a href="#既存のアプリケーションの配備解除">
既存のアプリケーションの配備解除</a><br />
</blockquote>
<primary>
<a href="#Executing Manager Commands With Ant">
Executing Manager Commands With Ant</a><br />
</primary>
<a href="#AntでのManagerコマンドの実行">
AntでのManagerコマンドの実行</a><br />
<primary>
<a href="#Using the JMX Proxy Servlet">
Using the JMX Proxy Servlet</a><br />
</primary>
<a href="#JMXプロキシサーブレットの使用">
JMXプロキシサーブレットの使用</a><br />
<primary>
<blockquote>
<a href="#What is JMX Proxy Servlet">What is JMX Proxy Servlet?</a><br />
<a href="#JMX Query command">Query command</a><br />
<a href="#JMX Set command">Set command</a><br />
</blockquote>
</primary>
<blockquote>
<a href="#JMXプロキシサーブレットとは">JMXプロキシサーブレットとは</a><br />
<a href="#JMXクエリコマンド">クエリコマンド</a><br />
<a href="#JMX設定コマンド">設定コマンド</a><br />
</blockquote>
</p>

</section>

<primary>
<section name="Introduction"/>
</primary>
<section name="はじめに">

<primary>
<p>In many production environments, it is very useful to have the capability
to deploy a new web application, or undeploy an existing one, without having
to shut down and restart the entire container.  In addition, you can request
an existing application to reload itself, even if you have not declared it
to be <code>reloadable</code> in the Tomcat 5 server
configuration file.</p>
</primary>
<p>コンテナ全体のシャットダウン・再起動をせずに、
新しいWebアプリケーションを配備したり、
既存のWebアプリケーションを配備解除したりする機能は、
多くの本番環境でとても役立ちます。
さらに、Tomcat 5 サーバ設定ファイルで <code>reloadable</code> を定義しなくても、
既存のアプリケーションに再ロードを要求することも可能です。</p>

<primary>
<p>To support these capabilities, Tomcat 5 includes a web application
(installed by default on context path <code>/manager</code>) that supports
the following functions:</p>
</primary>
<p>こうした機能をサポートするために、Tomcat 5 には以下の機能をサポートする
Webアプリケーションがあります (デフォルトではコンテキストパス 
<code>/manager</code> でインストールされています)。</p>
<primary>
<ul>
<li>Deploy a new web application, on a specified context path, from
    the uploaded contents of a WAR file.</li>
<li>Install a new web application, which can be anywhere on the
    server's disks.</li>
<li>List the currently deployed web applications, as well as the
    sessions that are currently active for those web apps.</li>
<li>Reload an existing web application, to reflect changes in the
    contents of <code>/WEB-INF/classes</code> or <code>/WEB-INF/lib</code>.
    </li>
<li>List the OS and JVM property values.</li>
<li>List the available global JNDI resources, for use in deployment
    tools that are preparing <code>&lt;ResourceLink&gt;</code> elements
    nested in a <code>&lt;Context&gt;</code> deployment description.</li>
<li>List the available security roles defined in the user database.</li>
<li>Remove an installed web application.</li>
<li>Start a stopped application (thus making it available again).</li>
<li>Stop an existing application (so that it becomes unavailable), but
    do not undeploy it.</li>
<li>Undeploy a deployed web application and delete its document base
    directory.</li>
</ul>
</primary>
<ul>
<li>新しいWebアプリケーションを、指定したコンテキストパスで、
    WARファイルをアップロードして配備します。</li>
<li>サーバのディスクから新しいWebアプリケーションをインストールします。
    サーバのディスクのどこにあってもかまいません。</li>
<li>配備済みのWebアプリケーションを、
    Webアプリで現在アクティブなセッションとともに一覧表示します。</li>
<li><code>/WEB-INF/classes</code> や <code>/WEB-INF/lib</code>
    の内容変更を反映するために、既存の Webアプリケーションを再ロードします。</li>
<li>OS や JVM のプロパティ値を一覧表示します。</li>
<li>利用可能なグローバル JNDI リソースを一覧表示します。これは
    <code>&lt;Context&gt;</code> 配備記述内で入れ子になっている
    <code>&lt;ResourceLink&gt;</code> 要素を準備する配備ツールで使用します。
    </li>
<li>ユーザデータベースで定義された、利用可能なセキュリティロールを一覧表示します。    </li>
<li>インストール済みの Webアプリケーションを削除します。</li>
<li>停止したアプリケーションを起動 (そして再び利用可能に) します。</li>
<li>(利用不可にするために) 既存のアプリケーションを停止しますが、
    配備解除はしません。</li>
<li>配備済みのWebアプリケーションを配備解除し、
    ドキュメントベースのディレクトリを削除します。</li>
</ul>

<primary>
<p>There are two ways to configure the Manager web application
<code>Context</code>:
<ul>
<li>Install the <code>manager.xml</code> context configuration file
    in the <code>appBase</code> for your <code>Host</code>.</li>
<li>Configure the Manager <code>Context</code> within the
    <code>Host</code> configuration in your Tomcat <code>server.xml</code>
    configuration. Here is an example:
<pre>
&lt;Context path="/manager" debug="0" privileged="true"
         docBase="/usr/local/kinetic/tomcat5/server/webapps/manager"&gt;
&lt;/Context&gt;
</pre>
</li>
</ul>
</p>
</primary>
<p>Manager Webアプリケーションの <code>Context</code> 設定方法は2種類あります。
<ul>
<li><code>Host</code> を示す <code>appBase</code> 上にある
    <code>manager.xml</code> コンテキスト設定ファイルをインストールします。</li>
<li>Tomcat <code>server.xml</code> ファイルの <code>Host</code> 設定内の
    Manager <code>Context</code> を設定します。以下に例を示します。
<pre>
&lt;Context path="/manager" debug="0" privileged="true"
         docBase="/usr/local/kinetic/tomcat5/server/webapps/manager"&gt;
&lt;/Context&gt;
</pre>
</li>
</ul>
</p>

<primary>
<p>If you have Tomcat configured to support multiple virtual hosts
(websites) you would need to configure a Manager for each.</p>
</primary>
<p>複数の仮想ホスト (Webサイト) をサポートするように設定するなら、
それぞれで Manager を設定する必要があります。</p>

<primary>
<p>There are three ways to use the <code>Manager</code> web application.
<ul>
<li>As an application with a user interface you use in your browser.
Here is an example URL where you can replace <code>localhost</code> with
your website host name:  <code>http://localhost/manager/html/</code> .</li>
<li>A minimal version using HTTP requests only which is suitable for use
by scripts setup by system administrators.  Commands are given as part of the
request URI, and responses are in the form of simple text that can be easily
parsed and processed.  See <a href="#Supported Manager Commands">
Supported Manager Commands</a> for more information.</li>
<li>A convenient set of task definitions for the <em>Ant</em>
(version 1.4 or later) build tool.  See
<a href="#Executing Manager Commands With Ant">Executing Manager Commands
With Ant</a> for more information.</li>
</ul>
</p>
</primary>
<p><code>Manager</code> Webアプリケーションの使用方法は3種類あります。
<ul>
<li>ユーザインタフェースとしてブラウザを使うアプリケーション。
以下の URL で <code>localhost</code> を Webサイトのホスト名に置き換えて下さい：
<code>http://localhost/manager/html/</code></li>
<li>HTTPリクエストのみを使った最小版。
システム管理者がスクリプトでセットアップするのに適しています。
コマンドはリクエストURLの一部として送られ、
レスポンスは簡単に解析・処理できるように単純テキスト形式となっています。
詳しくは <a href="#サポートされるManagerコマンド">サポートされるManagerコマンド</a>
をご覧下さい。</li>
<li><em>Ant</em> (バージョン1.4以降) ビルドツールで便利な一連のタスク定義。
詳しくは <a href="#AntでのManagerコマンドの実行">AntでのManagerコマンドの実行</a>
をご覧下さい。</li>
</ul>
</p>

<primary>
<p>Future versions of Tomcat 5 will include administrative functionality that
is presented in (at least) the following forms:
<ul>
<li>As web services, so that Tomcat administration can be easily integrated
    into remote and/or non-Java mnagement environments.</li>
<li>As a web application with a nice user interface (built on top of the
    web services processing layer) for easy Tomcat administration via a
    web browser.</li>
</ul>
</p>
</primary>
<p>Tomcat 5 の将来のバージョンでは (少なくとも)
以下の形式での管理機能が追加される予定です。
<ul>
<li>Webサービス。これを使うとリモートかつ/またはJava以外の管理環境と簡単に統合できます。</li>
<li>Webブラウザで Tomcat を簡単に管理するための、
    優れたユーザインタフェースを持つ Webサービス
    (Webサービス処理層の上に構築)。</li>
</ul>
</p>
<note>mnagement→management</note>
</section>

<primary>
<section name="Configuring Manager Application Access"/>
</primary>
<section name="Managerアプリケーションへのアクセス設定">

<primary>
    <blockquote><em>
    <p>The description below uses the variable name $CATALINA_HOME
    to refer to the directory into which you have installed Tomcat 5,
    and is the base directory against which most relative paths are
    resolved.  However, if you have configured Tomcat 5 for multiple
    instances by setting a CATALINA_BASE directory, you should use
    $CATALINA_BASE instead of $CATALINA_HOME for each of these
    references.</p>
    </em></blockquote>
</primary>
    <blockquote><em>
    <p>以下の記述で、変数名 $CATALINA_HOME は
    Tomcat 5 をインストールしたディレクトリを指し、
    これを基準にほとんどの相対パスを解決するディレクトリです。
    ただし、複数インスタンスで Tomcat 5 を設定した場合は、
    $CATALINA_HOME の代わりに $CATALINA_BASE を使って下さい。</p>
    </em></blockquote>

<primary>
<p>It would be quite unsafe to ship Tomcat with default settings that allowed
anyone on the Internet to execute the Manager application on your server.
Therefore, the Manager application is shipped with the requirement that anyone
who attempts to use it must authenticate themselves, using a username and
password that have the role <strong>manager</strong> associated with them.
Further, there is no username in the default users file
(<conf>$CATALINA_HOME/conf/tomcat-users.xml</conf>) that is assigned this
role.  Therefore, access to the Manager application is completely disabled
by default.</p>
</primary>
<p>Tomcat の出荷時のデフォルトの設定で、サーバの Manager 
アプリケーションをインターネット上の誰でも実行できるようになっていたら、
まったく安全ではありません。そこで Tomcat 出荷時には、
Manager を使おうとする人は誰でも、関連する <strong>manager</strong>
ロールを持ったユーザ名とパスワードを使った認証が必須となっています。
さらに、デフォルトのユーザファイル 
(<conf>$CATALINA_HOME/conf/tomcat-users.xml</conf>) では
このロールに関連するユーザ名はありません。したがって、Manager 
アプリケーションへのアクセスはデフォルトでは完全に無効となっています。
</p>

<primary>
<p>To enable access to the Manager web application, you must either create
a new username/password combination and associate the role name
<strong>manager</strong> with it, or add the <strong>manager</strong> role
to some existing username/password combination.  Exactly where this is done
depends on which <code>Realm</code> implementation you are using:</p>
</primary>
<p>Manager Web アプリケーションにアクセスできるようにするには、
新規作成したユーザ名/パスワードをロール名 <strong>manager</strong>
と関連づけるか、<strong>manager</strong> ロールに既存のユーザ名/パスワードを
関連づけなければなりません。これを行なう具体的なやり方は、以下の
<code>Realm</code>実装のうち、どれを使っているかによって違います。
</p>
<primary>
<ul>
<li><em>MemoryRealm</em> - If you have not customized your
    <code>$CATALINA_HOME/conf/server.xml</code> to select a different one,
    Tomcat 5 defaults to an XML-format file stored at
    <code>$CATALINA_HOME/conf/tomcat-users.xml</code>, which can be
    edited with any text editor.  This file contains an XML
    <code>&lt;user&gt;</code> for each individual user, which might
    look something like this:
<source>
&lt;user name="craigmcc" password="secret" roles="standard,manager" /&gt;
</source>
    which defines the username and password used by this individual to
    log on, and the role names he or she is associated with.  You can
    add the <strong>manager</strong> role to the comma-delimited
    <code>roles</code> attribute for one or more existing users, and/or
    create new users with that assigned role.</li>
<li><em>JDBCRealm</em> - Your user and role information is stored in
    a database accessed via JDBC.  Add the <strong>manager</strong> role
    to one or more existing users, and/or create one or more new users
    with this role assigned, following the standard procedures for your
    environment.</li>
<li><em>JNDIRealm</em> - Your user and role information is stored in
    a directory server accessed via LDAP.  Add the <strong>manager</strong>
    role to one or more existing users, and/or create one or more new users
    with this role assigned, following the standard procedures for your
    environment.</li>
</ul>
</primary>
<ul>
<li><em>MemoryRealm</em> - 他のレルムを使うように
    <code>$CATALINA_HOME/conf/server.xml</code> をカスタマイズしていなければ、
    Tomcat 5 はデフォルトでは <code>$CATALINA_HOME/conf/tomcat-users.xml</code>
    という XML 形式のファイルを使うようになっており、
    どんなテキストエディタでも編集可能です。このファイルにはユーザごとに
    <code>&lt;user&gt;</code> という XML が含まれており、
    以下のような感じになっています。
<source>
&lt;user name="craigmcc" password="secret" roles="standard,manager" /&gt;
</source>
    ここではログオンする人が使うユーザ名とパスワード、
    それにこの人が関連するロール名が定義されています。
    <strong>manager</strong> ロールにコンマ区切りの <code>roles</code> 
    属性を追加することもできますし、
	割り当てたこのロールに対して新しいユーザを作成することもできます。
    またその両方を行なうことも可能です</li>
<li><em>JDBCRealm</em> - ユーザとロールの情報を JDBC 経由でアクセスする
    データベースに保存します。<strong>manager</strong> 
    ロールを1人以上の既存ユーザに関連づけることもできますし、
    あなたの環境での標準手順にしたがって、
    割り当てたこのロールに対して1人以上の新しいユーザを作成することもできます。
    またその両方を行なうことも可能です。</li>
<li><em>JNDIRealm</em> - ユーザとロールの情報を LDAP 経由でアクセスする
    ディレクトリサーバに保存します。<strong>manager</strong>
    ロールを1人以上の既存ユーザに関連づけることもできますし、
    あなたの環境での標準手順にしたがって、
    割り当てたこのロールに対して1人以上の新しいユーザを作成することもできます。
    またその両方を行なうことも可能です。</li>
</ul>

<primary>
<p>The first time you attempt to issue one of the Manager commands
described in the next section, you will be challenged to log on using
BASIC authentication.  The username and password you enter do not matter,
as long as they identify a valid user in the users database who possesses
the role <strong>manager</strong>.</p>
</primary>
<p>次のセクションで記述する Managerコマンドのいずれかを最初に実行する際には、
BASIC認証を使ってログオンしようとします。 <strong>manager</strong>
ロールを所有するユーザデータベース内の妥当なユーザと認証される限り、
どのユーザ／パスワードを入力してもかまいません。</p>

<primary>
<p>In addition to the password restrictions the manager web application
could be restricted by the remote IP address or host by adding a
<code>RemoteAddrValve</code> or <code>RemoteHostValve</code>.  Here is
an example of restricting access to the localhost by IP address:
<pre>
&lt;Context path="/manager" debug="0" privileged="true"
         docBase="/usr/local/kinetic/tomcat5/server/webapps/manager"&gt;
         &lt;Valve className="org.apache.catalina.valves.RemoteAddrValve"
                allow="127.0.0.1"/&gt;
&lt;/Context&gt;
</pre>
</p>
</primary>
<p>パスワードによる制限の他に、Manager Webアプリケーションでは
<code>RemoteAddrValve</code> や <code>RemoteHostValve</code>
を加えることでリモートIPアドレスやホストによる制限をかけられます。
アクセスをローカルホストのIPアドレスに制限する例を示します。
<pre>
&lt;Context path="/manager" debug="0" privileged="true"
         docBase="/usr/local/kinetic/tomcat5/server/webapps/manager"&gt;
         &lt;Valve className="org.apache.catalina.valves.RemoteAddrValve"
                allow="127.0.0.1"/&gt;
&lt;/Context&gt;
</pre>
</p>
</section>


<primary>
<section name="Supported Manager Commands"/>
</primary>
<section name="サポートされるManagerコマンド">

<primary>
<p>All commands that the Manager application knows how to process are
specified in a single request URI like this:</p>
</primary>
<p>Manager アプリケーションが実行可能なコマンドは全て、
以下のような単独のリクエストURIで指定します。:</p>
<source>
http://{host}:{port}/manager/{command}?{parameters}
</source>
<primary>
<p>where <code>{host}</code> and <code>{port}</code> represent the hostname
and port number on which Tomcat is running, <code>{command}</code>
represents the Manager command you wish to execute, and
<code>{parameters}</code> represents the query parameters
that are specific to that command.  In the illustrations below, customize
the host and port appropriately for your installation.</p>
</primary>
<p>ここで <code>{host}</code> と <code>{port}</code> は Tomcat
が動作するホスト名とポート番号を、<code>{command}</code>
は実行したい Manager コマンドを、<code>{parameters}</code> 
はコマンド固有の問い合わせパラメータを示します。以下の例を実際に使う時は、
インストールに合わせてホストやポートを変えてください。</p>

<primary>
<p>Most commands accept one or more of the following query parameters:</p>
</primary>
<p>ほどんどのコマンドでは以下の問い合わせパラメータを1個以上使えます。</p>
<primary>
<ul>
<li><strong>path</strong> - The context path (including the leading slash)
    of the web application you are dealing with.  To select the ROOT web
    application, specify a zero-length string.  <strong>NOTE</strong> -
    It is not possible to perform administrative commands on the
    Manager application itself.</li>
<li><strong>war</strong> - URL of a web application archive (WAR) file,
    pathname of a directory which contains the web application, or a
    Context configuration ".xml" file.  You can use URLs in any of the
    following formats:
    <ul>
    <li><strong>file:/absolute/path/to/a/directory</strong> - The absolute
        path of a directory that contains the unpacked version of a web
        application.  This directory will be attached to the context path
        you specify without any changes.</li>
    <li><strong>file:/absolute/path/to/a/webapp.war</strong> - The absolute
        path of a web application archive (WAR) file.  This is valid
        <strong>only</strong> for the <code>/deploy</code> command, and is
        the only acceptable format to that command.</li>
    <li><strong>jar:file:/absolute/path/to/a/warfile.war!/</strong> - The
        URL to a local web application archive (WAR) file.  You can use any
        syntax that is valid for the <code>JarURLConnection</code> class
        for reference to an entire JAR file.</li>
    <li><strong>file:/absolute/path/to/a/context.xml</strong> - The
        absolute path of a web application Context configuration ".xml"
        file which contains the Context configuration element.</li>
    <li><strong>directory</strong> - The directory name for the web
        applciation context in the Host's application base directory.</li>
    <li><strong>webapp.war</strong> - The name of a web application war file
        located in the Host's application base directory.</li>
    </ul></li>
</ul>
</primary>
<ul>
<li><strong>path</strong> - 対象の Webアプリケーションのコンテキストパス
    (先頭のスラッシュを含む)。ROOT Webアプリケーションの場合は、
    長さ0の文字列を指定します。<strong>注意</strong> -
    Manager アプリケーション自身の管理コマンドは実行できません。</li>
<li><strong>war</strong> - Webアプリケーションアーカイブ (WAR) ファイルのURL、
    Webアプリケーションを含むディレクトリのパス名、コンテキスト設定 ".xml"
    ファイルのいずれか。以下のいずれかの形式で URL を指定できます。
    <ul>
    <li><strong>file:/absolute/path/to/a/directory</strong> - Web
        アプリケーションの展開したバージョンを含むディレクトリのパス。
        このディレクトリは特に変更することなく、
        指定したコンテキストパスに追加可能です。</li>
    <li><strong>file:/absolute/path/to/a/webapp.war</strong> - Web
        アプリケーションアーカイブ (WAR) ファイルの絶対パス。
        <code>/deploy</code> コマンドで <strong>のみ</strong> 妥当で、
        このコマンドではこの形式のみサポートします。</li>
    <li><strong>jar:file:/absolute/path/to/a/warfile.war!/</strong> - ローカルの        Webアプリケーションアーカイブ (WAR) ファイルの URL。
        JAR ファイル全体を参照する <code>JarURLConnection</code> 
        クラスで有効な構文はすべて使用可能です。</li>
    <li><strong>file:/absolute/path/to/a/context.xml</strong> - 
        コンテキスト設定要素を含む Webアプリケーションコンテキスト設定 ".xml" 
        ファイルの絶対パス。</li>
    <li><strong>directory</strong> - ホストのアプリケーション基準ディレクトリ内にある 
        Webアプリケーションコンテキストのディレクトリ名。</li>
    <li><strong>webapp.war</strong> - ホストのアプリケーション基準ディレクトリ内にある 
        Webアプリケーションの WARファイル名。</li>
    </ul></li>
</ul>

<primary>
<p>Each command will return a response in <code>text/plain</code> format
(i.e. plain ASCII with no HTML markup), making it easy for both humans and
programs to read).  The first line of the response wil begin with either
<code>OK</code> or <code>FAIL</code>, indicating whether the requested
command was successful or not.  In the case of failure, the rest of the first
line will contain a description of the problem that was encountered.  Some
commands include additional lines of information as described below.</p>
</primary>
<p>各コマンドは人・プログラムのどちらでも読みやすいように、<code>text/plain</code> 
形式 (HTMLマークアップなしの素のASCII) のレスポンスを返します。
レスポンスの1行目は <code>成功</code> か <code>失敗</code> のどちらかで始まり、
リクエストしたコマンドが成功したかどうかを示します。失敗した場合は、
1行目の残りの部分に起こった問題の説明が出力されます。
コマンドによっては2行目以降に追加情報 (後述) を出力することもあります。</p>

<primary>
<p><em>Internationalization Note</em> - The Manager application looks up
its message strings in resource bundles, so it is possible that the strings
have been translated for your platform.  The examples below show the English
version of the messages.</p>
</primary>
<p><em>国際化に関する注意</em> - Manager 
アプリケーションではリソースバンドル内のメッセージを検索するため、
環境によっては文字列が外国語で表示される可能性があります。
以下に示す例ではメッセージの日本語バージョンを示します。
</p>
<note>原文では「英語バージョン」ですが、メッセージも翻訳しているので
「日本語バージョン」と訳し変えています。</note>

<primary>
<subsection name="Deploy A New Application Remotely"/>
</primary>
<subsection name="リモートへの新しいアプリケーションの配備">

<source>
http://localhost:8080/manager/deploy?path=/foo
</source>

<primary>
<p>Upload the web application archive (WAR) file that is specified as the
request data in this HTTP PUT request, install it into the <code>appBase</code>
directory of our corresponding virtual host, and start it on the context path
specified by the <code>path</code> request parameter.  If no <code>path</code>
is specified the directory name or the war file name without the .war extension
is used as the path.  The application can
later be undeployed (and the corresponding application directory removed)
by use of the <code>/undeploy</code>.</p>
</primary>
<p>HTTP PUT リクエストのリクエストデータとして指定した Web アプリケーションアーカイブ 
(WAR) ファイルをアップロードし、当該仮想ホストの <code>appBase</code> 
にインストールし、<code>path</code> 
リクエストパラメータで指定したコンテキストパスで起動します。
<code>path</code> が指定されない場合は、ディレクトリ名または拡張子 (.war)
を除いた WAR ファイル名がパスとして使用されます。<code>/undeploy</code>
を使うと、このアプリケーションを後で配備解除 
(さらに当該アプリケーションディレクトリを削除) できます。</p>

<primary>
<p>The .WAR file may include Tomcat specific deployment configuration, by 
including a Context configuration XML file in 
<code>/META-INF/context.xml</code>.</p>
</primary>
<p>.WAR ファイルには、<code>/META-INF/context.xml</code> というコンテキスト設定
XML ファイルの形で Tomcat 固有の配備設定を含めることができます。</p>

<primary>
<p>URL parameters include:
<ul>
<li><code>update</code>: When set to true, any existing update will be
    undeployed first. The default value is set to false.</li>
<li><code>tag</code>: Specifying a tag name, this allows associating the
    deployed webapp with a version number. The application version can
    be later redeployed when needed using only the tag.</li>
<li><code>pause</code>: Pause webapps so that incoming connections are not lost
    during an application update. This option is only used with the update
    parameter, and its default is false. Note that a large amount of request
    processors may be used if the amount of incoming requests is large.</li>
</ul>
</p>
</primary>
<p>URL パラメータは以下の通りです。
<ul>
<li><code>update</code>: true と設定すると、同名のコンテキストがある場合に、
    先に配備解除を行ないます。デフォルト値は false
    に設定されています。</li>
<li><code>tag</code>: タグ名を指定することで、配備した Web 
    アプリケーションをバージョン番号と関連づけることができます。tag 
    を使うだけで、アプリケーションのバージョンを後で変えることができます。</li>
<li><code>pause</code>: アプリケーション更新の間に到着した接続が失われないように、
    Web アプリケーションを一時停止します。このオプションは update 
    パラメータが指定された場合にのみ使用可能で、デフォルト値は false です。
    到着リクエスト数が多い場合は、リクエスト処理量が大きくなるかもしれないので
    ご注意ください。</li>
</ul>
</p>

<primary>
<p><strong>NOTE</strong> - This command is the logical
opposite of the <code>/undeploy</code> command.</p>
</primary>
<p><strong>注意</strong> - このコマンドは <code>/undeploy</code> 
コマンドの反対です</p>

<primary>
<p>If installation and startup is successful, you will receive a response
like this:</p>
</primary>
<p>もしインストールと起動が成功すると、以下のようなレスポンスが返ってきます。</p>
<primary>
<source>
OK - Deployed application at context path /foo
</source>
</primary>
<source>
成功 - コンテキストパス /foo でアプリケーションを配備しました 
</source>

<primary>
<p>Otherwise, the response will start with <code>FAIL</code> and include an
error message.  Possible causes for problems include:</p>
</primary>
<p>そうでなければ、レスポンスは <code>失敗</code> で始まるエラーメッセージとなります。
問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Application already exists at path /foo</em>
    <blockquote>
    <p>The context paths for all currently running web applications must be
    unique.  Therefore, you must either remove or undeploy the existing web
    application using this context path, or choose a different context path
    for the new one. The <code>update</code> parameter may be specified as
    a parameter on the URL, with a value of <code>true</code> to avoid this
    error. In that case, an undeploy will be performed on an existing
    application before performing the deployment.</p>
    </blockquote></li>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to start the new web application.
    Check the Tomcat 5 logs for the details, but likely explanations include
    problems parsing your <code>/WEB-INF/web.xml</code> file, or missing
    classes encountered when initializing application event listeners and
    filters.</p>
    </blockquote></li>
<li><em>Invalid context path was specified</em>
    <blockquote>
    <p>The context path must start with a slash character, unless you are
    referencing the ROOT web application -- in which case the context path
    must be a zero-length string.</p>
    </blockquote></li>
<li><em>No context path was specified</em>
    <blockquote>
    The <code>path</code> parameter is required.
    </blockquote></li>
</ul>
</primary>
<ul>
<li><em>失敗 - アプリケーションは、既にパス /foo に存在します</em>
    <blockquote>
    <p>現在実行中のWebアプリケーションのコンテキストパスは重複してはいけません。    したがって、このコンテキストパスを使っている既存のアプリケーションを
    削除または配備解除するか、別のコンテキストパスにしなければなりません。
    このエラーを回避するには、URL へのパラメータとして <code>update</code> 
    パラメータを <code>true</code> に指定するという方法もあります。その場合は、
    配備を行なう前に、既存のアプリケーションに対して配備解除が行なわれます。</p>
    </blockquote></li>
<li><em>失敗 - 例外が発生しました</em>
    <blockquote>
    <p>新しい Webアプリケーションの起動の際に例外が発生しました。詳細については
    Tomcat 5 のログをチェックする必要がありますが、<code>/WEB-INF/web.xml</code>
    ファイルの解析での問題か、アプリケーションのイベントリスナーやフィルターの初期化の際にクラスがない可能性が考えられます。</p>
    </blockquote></li>
<li><em>失敗 - 無効なコンテキストパスが指定されました</em>
    <blockquote>
    <p>コンテキストパスはスラッシュで始まらなければなりません。ROOT
    Webアプリケーションを参照する場合は例外で、
    この場合はコンテキストパスは長さ0の文字列になります。</p>
    </blockquote></li>
<li><em>コンテキストパスが指定されていません</em>
    <blockquote>
    <code>path</code> パラメータが必要です。
    </blockquote></li>
</ul>

</subsection>

<primary>
<subsection name="Deploy A New Application from a Local Path"/>
</primary>
<subsection name="ローカルパスからの新しいアプリケーションの配備">

<primary>
<p>Install and start a new web application, attached to the specified context
<code>path</code> (which must not be in use by any other web application).
This command is the logical opposite of the <code>/remove</code> command.</p>
</primary>
<p>(Web アプリケーションで使われていていない) <code>path</code>
でコンテキストを指定して、新しい Web アプリケーションをインストール・起動します。
このコマンドは <code>/remove</code> コマンドの反対です。</p>

<primary>
<p>There are a number of different ways the install command can be used.</p>
</primary>
<p>インストールコマンドの使い方は何通りもあります。</p>

<primary>
<h3>Install a version of a previously deployed webapp</h3>
</primary>
<h3>以前に配備したバージョンの Webアプリのインストール</h3>

<primary>
<p>This can be used to deploy a previous version of a web applicaion, which
has been deployed using the <code>tag</code> attribute. Note that the work
directory for the manager webapp will contain the previously deployed WARs;
removing it would make the deployment fail.
<source>
http://localhost:8080/manager/deploy?path=/footoo&amp;tag=footag
</source>
</p>
</primary>
<p><code>tag</code> 属性を使って配備された以前のバージョンの
Webアプリケーションを配備するのに使えます。
manager Webアプリの作業ディレクトリには、
以前に配備した WARファイルが入っていますが、
それを削除した場合には配備が失敗することにご注意ください。
<source>
http://localhost:8080/manager/deploy?path=/footoo&amp;tag=footag
</source>
</p>

<primary>
<h3>Install a Directory or WAR by URL</h3>
</primary>
<h3>URLで指定したディレクトリまたは WARファイルのインストール</h3>

<primary>
<p>Install a web application directory or ".war" file located on the Tomcat
server. If no <code>path</code> is specified, the directory name or the war file
name without the ".war" extension is used as the path. The <code>war</code>
parameter specifies a URL (including the <code>file:</code> scheme) for either
a directory or a web application archive (WAR) file. The supported syntax for
a URL referring to a WAR file is described on the Javadocs page for the
<code>java.net.JarURLConnection</code> class.  Use only URLs that refer to
the entire WAR file.</p>
</primary>
<p>Tomcat サーバ上にある Webアプリケーションディレクトリまたは ".war" 
ファイルをインストールします。<code>path</code> が指定されていない場合は、
ディレクトリ名、または WARファイル名から拡張子「.war」をとったものがパスとして使われます。
ディレクトリ名や Webアプリケーションアーカイブ (WAR) ファイルについては、
<code>war</code> パラメータで指定します。WARファイル参照 URL 
でサポートされている構文については、<code>java.net.JarURLConnection</code>
クラスの Javadoc ページに記載されています。
WARファイル全体を参照する URL しか使えません。</p>

<primary>
<p>In this example the web application located in the directory
<code>/path/to/foo</code> on the Tomcat server is installed as the
web application context named <code>/footoo</code>.
<source>
http://localhost:8080/manager/deploy?path=/footoo&amp;war=file:/path/to/foo
</source>
</p>
</primary>
<p>以下の例では Tomcat サーバの <code>/path/to/foo</code> 
ディレクトリにある Webアプリケーションを <code>/footoo</code>
というコンテキストとしてインストールします。
<source>
http://localhost:8080/manager/deploy?path=/footoo&amp;war=file:/path/to/foo
</source>
</p>

<primary>
<p>In this example the ".war" file <code>/path/to/bar.war</code> on the
Tomcat server is installed as the web application context named
<code>/bar</code>. Notice that there is no <code>path</code> parameter
so the context path defaults to the name of the web application archive
file without the ".war" extension.
<source>
http://localhost:8080/manager/deploy?war=jar:file:/path/to/bar.war!/
</source>
</p>
</primary>
<p>以下の例では Tomcat サーバの <code>/path/to/bar.war</code> 
にある「.war」ファイルを、<code>/bar</code> というコンテキストの
Web アプリケーションとしてインストールします。<code>path</code> パラメータがないので、
コンテキストパスはデフォルト値である、Webアプリケーションアーカイブファイル名から拡張子
「.war」を取ったものとなることにご注意ください。
<source>
http://localhost:8080/manager/deploy?war=jar:file:/path/to/bar.war!/
</source>
</p>

<primary>
<h3>Install a Directory or War from the Host appBase</h3>
</primary>
<h3>ホストの appBase 指定でのディレクトリや WAR ファイルのインストール</h3>

<primary>
<p>Install a web application directory or ".war" file located in your Host
appBase directory. If no <code>path</code> is specified the directory name
or the war file name without the ".war" extension is used as the path.</p>
</primary>
<p>ホストの appBaseディレクトリ配下の Webアプリケーションのディレクトリまたは
".war"ファイルをインストールします。<code>path</code> が指定されていない場合は、
ディレクトリ名、またはWARファイル名から拡張子".war"を省いた名前がパスとして使われます。</p>

<primary>
<p>In this example the web application located in a sub directory named
<code>foo</code> in the Host appBase directory of the Tomcat server is
installed as the web application context named <code>/foo</code>. Notice
that there is no <code>path</code> parameter so the context path defaults
to the name of the web application directory.
<source>
http://localhost:8080/manager/deploy?war=foo
</source>
</p>
</primary>
<p>以下の例では Tomcatサーバのホストの appBaseディレクトリの下の
<code>foo</code> ディレクトリにある Webアプリケーションが
<code>/foo</code> という Webアプリケーションコンテキストでインストールされます。
<code>path</code> パラメータが指定されていないので、
コンテキストパスはデフォルトの 
Webアプリケーションのディレクトリ名となっていることに注意して下さい。
<source>
http://localhost:8080/manager/deploy?war=foo
</source>
</p>

<primary>
<p>In this example the ".war" file <code>bar.war</code> located in your
Host appBase directory on the Tomcat server is installed as the web
application context named <code>/bartoo</code>.
<source>
http://localhost:8080/manager/deploy?path=/bartoo&amp;war=bar.war
</source>
</p>
</primary>
<p>以下の例では Tomcatサーバのホストの appBaseディレクトリにある
<code>bar.war</code> という".war"ファイルが <code>/bartoo</code>
という Webアプリケーションコンテキストでインストールされます。
<source>
http://localhost:8080/manager/deploy?path=/bartoo&amp;war=bar.war
</source>
</p>

<primary>
<h3>Install using a Context configuration ".xml" file</h3>
</primary>
<h3>コンテキスト設定".xml"ファイルを使ったインストール</h3>

<primary>
<p>If the Host deployXML flag is set to true you can install a web
application using a Context configuration ".xml" file and an optional
".war" file or web application directory. The context <code>path</code>
is not used when installing a web application using a context ".xml"
configuration file.</p>
</primary>
<p>ホストの deployXML フラグが true の場合、コンテキスト設定
".xml"ファイルと、オプションで ".war"ファイルまたは 
Webアプリケーションディレクトリを使って 
Webアプリケーションをインストールできます。
コンテキスト設定".xml"ファイルを使って
Webアプリケーションをインストールする際には コンテキストの <code>path</code>
は使われません。</p>

<primary>
<p>A Context configuration ".xml" file can contain valid XML for a
web application Context just as if it were configured in your
Tomcat <code>server.xml</code> configuration file. Here is an
example:
<source>
&lt;Context path="/foobar" docBase="/path/to/application/foobar"
         debug="0"&gt;

  &lt;!-- Link to the user database we will get roles from --&gt;
  &lt;ResourceLink name="users" global="UserDatabase"
                type="org.apache.catalina.UserDatabase"/&gt;

&lt;/Context&gt;
</source>
</p>
</primary>
<p>コンテキスト設定".xml"ファイルには、Tomcat の 
<code>server.xml</code> で設定するのと同じように
妥当な XML を記述できます。以下に例を示します。
<source>
&lt;Context path="/foobar" docBase="/path/to/application/foobar"
         debug="0"&gt;

  &lt;!-- ロールを取得するユーザデータベースへのリンク --&gt;
  &lt;ResourceLink name="users" global="UserDatabase"
                type="org.apache.catalina.UserDatabase"/&gt;

&lt;/Context&gt;
</source>
</p>

<primary>
<p>When the optional <code>war</code> parameter is set to the URL
for a web application ".war" file or directory it overrides any
docBase configured in the context configuration ".xml" file.</p>
</primary>
<p>オプションですが、 URL に <code>war</code> パラメータで 
Webアプリケーションの".war"ファイルまたはディレクトリが指定された場合は、
コンテキスト設定".xml"ファイルで設定された docBase はすべて上書きされます。</p>

<primary>
<p>Here is an example of installing an application using a Context
configuration ".xml" file.
<source>
http://localhost:8080/manager/deploy?config=file:/path/context.xml
</source>
</p>
</primary>
<p>コンテキスト設定".xml" 
ファイルを使ってアプリケーションをインストールする例を示します。
<source>
http://localhost:8080/manager/deploy?config=file:/path/context.xml
</source>
</p>

<primary>
<p>Here is an example of installing an application using a Context
configuration ".xml" file and a web application ".war" file located
on the server.
<source>
http://localhost:8080/manager/deploy?config=file:/path/context.xml&amp;war=jar:file:/path/bar.war!/
</source>
</p>
</primary>
<p>サーバ上のコンテキスト設定".xml"ファイルと Webアプリケーション 
".war"ファイルをインストールする例を示します。
<source>
http://localhost:8080/manager/deploy?config=file:/path/context.xml&amp;war=jar:file:/path/bar.war!/
</source>
</p>

<primary>
<h3>Installation Notes</h3>
</primary>
<h3>インストールでの注意事項</h3>

<primary>
<p>If the Host is configured with unpackWARs=true and you install a war
file, the war will be unpacked into a directory in your Host appBase
directory.</p>
</primary>
<p>unpackWARs=true という設定のホストで WARファイルをインストールすると、
WARファイルはホストの appBase ディレクトリに展開されます。</p>

<primary>
<p>If the application war or directory is installed in your Host appBase
directory and either the Host is configured with autoDeploy=true or
liveDeploy=true, the Context path must match the directory name or
war file name without the ".war" extension.</p>
</primary>
<p>アプリケーションの WARファイルやディレクトリがホストの appBase
ディレクトリに配備され、ホストで autoDeploy=true、liveDeploy=true
のいずれかに設定されている場合、コンテキストパスはディレクトリ名か、
WARファイル名から拡張子".war"を省いた名前に合致しなければなりません。</p>

<primary>
<p>For security when untrusted users can manage web applications, the
Host deployXML flag can be set to false.  This prevents untrusted users
from installing web applications using a configuration XML file and
also prevents them from installing application directories or ".war"
files located outside of their Host appBase.</p>
</primary>
<p>セキュリティ上の理由から、信頼されないユーザが 
Webアプリケーションを管理できる場合は、ホストの deployXML フラグは
false になっています。これにより、信頼されないユーザは、設定 XML 
ファイルを使って Webアプリケーションをインストールできないだけでなく、
ホストの appBase ディレクトリ配下にないアプリケーションディレクトリや ".war"
ファイルのインストールができないようになっています。</p>

<primary>
<h3>Install Response</h3>
</primary>
<h3>インストールに対するレスポンス</h3>

<primary>
<p>If installation and startup is successful, you will receive a response
like this:</p>
</primary>
<p>インストールと起動が成功すると、以下のようなレスポンスが返ってきます。</p>
<primary>
<source>
OK - Deployed application at context path /foo
</source>
</primary>
<source>
成功 - コンテキストパス /foo にアプリケーションをインストールしました
</source>

<primary>
<p>Otherwise, the response will start with <code>FAIL</code> and include an
error message.  Possible causes for problems include:</p>
</primary>
<p>そうでなければ、レスポンスは <code>失敗</code> で始まるエラーメッセージとなります。
問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Application already exists at path /foo</em>
    <blockquote>
    <p>The context paths for all currently running web applications must be
    unique.  Therefore, you must either remove or undeploy the existing web
    application using this context path, or choose a different context path
    for the new one. The <code>update</code> parameter may be specified as
    a parameter on the URL, with a value of <code>true</code> to avoid this
    error. In that case, an undeploy will be performed on an existing
    application before performing the deployment.</p>
    </blockquote></li>
<li><em>Document base does not exist or is not a readable directory</em>
    <blockquote>
    <p>The URL specified by the <code>war</code> parameter must identify a
    directory on this server that contains the "unpacked" version of a
    web application, or the absolute URL of a web application archive (WAR)
    file that contains this application.  Correct the value specified by
    the <code>war</code> parameter.</p>
    </blockquote></li>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to start the new web application.
    Check the Tomcat 5 logs for the details, but likely explanations include
    problems parsing your <code>/WEB-INF/web.xml</code> file, or missing
    classes encountered when initializing application event listeners and
    filters.</p>
    </blockquote></li>
<li><em>Invalid application URL was specified</em>
    <blockquote>
    <p>The URL for the directory or web application that you specified
    was not valid.  Such URLs must start with <code>file:</code>, and URLs
    for a WAR file must end in ".war".</p>
    </blockquote></li>
<li><em>Invalid context path was specified</em>
    <blockquote>
    <p>The context path must start with a slash character, unless you are
    referencing the ROOT web application -- in which case the context path
    must be a "/" string.</p>
    </blockquote></li>
<li><em>Context path must match the directory or WAR file name:</em>
    <blockquote>
    If the application war or directory is installed in your Host appBase
    directory and either the Host is configured with autoDeploy=true or
    liveDeploy=true, the Context path must match the directory name or
    war file name without the ".war" extension.
    </blockquote></li>
<li><em>Only web applications in the Host web application directory can
     be installed</em>
     <blockquote>
     If the Host deployXML flag is set to false this error will happen
     if an attempt is made to install a web application directory or
      ".war" file outside of the Host appBase directory.
     </blockquote></li>
</ul>
</primary>
<ul>
<li><em>アプリケーションは、既にパス  /foo に存在します</em>
    <blockquote>
    <p>現在動作している Webアプリケーションのコンテキストパスはすべて一意でなければなりません。
    したがって、このコンテキストパスを使っている既存の Webアプリケーションを配備解除するか、
    別のコンテキストパスにしなければなりません。URL で <code>update</code>
    パラメータに <code>true</code> を指定すれば、このエラーを回避できます。
    その場合、配備の前に既存のアプリケーションの配備解除が行なわれます。</p>
    </blockquote></li>
<li><em>ドキュメントベースが存在しない、又は読めないディレクトリです</em>
    <blockquote>
    <p><code>war</code> パラメータでで指定する URL は 
    Webアプリケーションの「展開済み」バージョンを含んだこのサーバのディレクトリか、
    このアプリケーションを含む Webアプリケーションアーカイブ (WAR)
    ファイルの絶対 URL でなければなりません。<code>war</code> 
    パラメータでに正しい値を指定してください。</p>
    </blockquote></li>
<li><em>例外が発生しました</em>
    <blockquote>
    <p>Webアプリケーション起動時に例外が発生しました。詳細については Tomcat 5
    のログをチェックする必要がありますが、<code>/WEB-INF/web.xml</code> 解析エラーや、
    アプリケーションイベントリスナやフィルタの初期化時にクラスが見つからなかった可能性もあります。</p>
    </blockquote></li>
<li><em>無効なアプリケーションのURLが指定されました</em>
    <blockquote>
    <p>指定したディレクトリまたは Webアプリケーションの URL
    が妥当でありません。この URL は <code>file:</code> で始まらなければならず、
    WARファイルの URL の場合、".war" で終わらなければなりません。</p>
    </blockquote></li>
<li><em>無効なコンテキストパスが指定されました</em>
    <blockquote>
    <p>コンテキストパスはスラッシュ ("/") で始まらなければなりません。
    ROOT Webアプリケーションを参照している場合は例外です
    -- この場合は、コンテキストパスは長さ0の文字列になります。</p>
    </blockquote></li>       
<li><em>コンテキストパスはディレクトリ又はWARファイル名に一致しなければいけません:</em>
    <blockquote>
    ホストの appBase ディレクトリにアプリケーションの
    WARファイルやディレクトリが配備され、ホストで autoDeploy=true、
    liveDeploy=true のどちらかの設定があった場合、
    コンテキストパスはディレクトリ名か、
    WARファイル名から拡張子".war"を省いた名前に合致しなければなりません。
    </blockquote></li>
<li><em>ホストWebアプリケーションディレクトリ中のWebアプリケーションだけがインストールできます</em>
    <blockquote>
    ホストの deployXML フラグが false になっていて、ホストの
    appBase ディレクトリ以外の場所に Webアプリケーションディレクトリや
    ".war" ファイルをインストールしようとするとこのエラーが発生します。
    </blockquote></li>
</ul>

</subsection>

<primary>
<subsection name="List Currently Deployed and Installed Applications"/>
</primary>
<subsection name="配備・インストール済のアプリケーションの一覧表示">

<source>
http://localhost:8080/manager/list
</source>

<primary>
<p>List the context paths, current status (<code>running</code> or
<code>stopped</code>), and number of active sessions for all currently
deployed and installed web applications.  A typical response immediately
after starting Tomcat might look like this:</p>
</primary>
<p>現在配備・インストールされている Webアプリケーションすべてについて、
コンテキストパスと現在のステータス (<code>running</code> または <code>stopped</code>)、
アクティブなセッション数を一覧表示します。Tomcat 起動直後の場合、
通常は以下のようなレスポンスを返します。</p>
<primary>
<source>
OK - Listed applications for virtual host localhost
/webdav:running:0
/examples:running:0
/manager:running:0
/:running:0
</source>
</primary>
<source>
成功 - バーチャルホスト localhost のアプリケーション一覧です
/webdav:running:0
/examples:running:0
/manager:running:0
/:running:0
</source>

</subsection>

<primary>
<subsection name="Reload An Existing Application"/>
</primary>
<subsection name="既存のアプリケーションの再ロード">

<source>
http://localhost:8080/manager/reload?path=/examples
</source>

<primary>
<p>Signal an existing application to shut itself down and reload.  This can
be useful when the web application context is not reloadable and you have
updated classes or property files in the <code>/WEB-INF/classes</code>
directory or when you have added or updated jar files in the
<code>/WEB-INF/lib</code> directory.
</p>
</primary>
<p>既存のアプリケーションにシャットダウンと再ロードを指示します。
Webアプリケーションコンテキストが再ロード可能になっていなくて
<code>/WEB-INF/classes</code> のクラスやプロパティファイルを更新した場合や、
<code>/WEB-INF/lib</code> ディレクトリの
JARファイルを更新した場合に便利かもしれません。
</p>
<primary>
<p><strong>NOTE:</strong> The <code>/WEB-INF/web.xml</code>
web application configuration file is not reread on a reload.
If you have made changes to your web.xml file you must stop
then start the web application.
</p>
</primary>
<p><strong>注意:</strong> <code>/WEB-INF/web.xml</code>
の Webアプリケーション設定ファイルは再ロード時にチェックされず、
以前の web.xml の設定が使われます。web.xml ファイルを変更した場合は、
Webアプリケーションを停止・起動しなければなりません
</p>

<primary>
<p>If this command succeeds, you will see a response like this:</p>
</primary>
<p>このコマンドが成功すると、以下のようなレスポンスが返ってきます。</p>
<primary>
<source>
OK - Reloaded application at context path /examples
</source>
</primary>
<source>
OK - コンテキストパス /examples のアプリケーションを再ロードしました
</source>

<primary>
<p>Otherwise, the response will start with <code>FAIL</code> and include an
error message.  Possible causes for problems include:</p>
</primary>
<p>そうでなければ、レスポンスは <code>失敗</code> で始まるエラーメッセージとなります。
問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to restart the web application.
    Check the Tomcat 5 logs for the details.</p>
    </blockquote></li>
<li><em>Invalid context path was specified</em>
    <blockquote>
    <p>The context path must start with a slash character, unless you are
    referencing the ROOT web application -- in which case the context path
    must be a zero-length string.</p>
    </blockquote></li>
<li><em>No context exists for path /foo</em>
    <blockquote>
    <p>There is no deployed or installed application on the context path
    that you specified.</p>
    </blockquote></li>
<li><em>No context path was specified</em>
    <blockquote>
    The <code>path</code> parameter is required.
    </blockquote></li>
<li><em>Reload not supported on WAR deployed at path /foo</em>
    <blockquote>
    Currently, application reloading (to pick up changes to the classes or
    <code>web.xml</code> file) is not supported when a web application is
    installed directly from a WAR file.  It only works when the web application
    is installed from an unpacked directory.  If you are using a WAR file,
    you should <code>remove</code> and then <code>install</code> the
    application again to pick up your changes.
    </blockquote></li>
</ul>
</primary>
<ul>
<li><em>例外が発生しました</em>
    <blockquote>             
    <p>Webアプリケーションの起動時に例外が発生しました。
    詳細については Tomcat 5 のログをチェックして下さい。</p>
    </blockquote></li>       
<li><em>無効なコンテキストパスが指定されました</em>
    <blockquote>             
    <p>コンテキストパスはスラッシュ ("/") で始まらなければなりません。
    ROOT Webアプリケーションを参照している場合は例外です
    -- この場合は、コンテキストパスは長さ0の文字列になります。</p>
    </blockquote></li>       
<li><em>パス /foo のコンテキストが存在しません</em>
    <blockquote>             
    <p>指定したコンテキストのアプリケーションは配備されていません。</p>  
    </blockquote></li>       
<li><em>コンテキストパスが指定されていません</em>
    <blockquote>             
    <code>path</code> パラメータが必要です。
    </blockquote></li>       
<li><em>パス /foo に配備されたWARファイルでは再ロードがサポートされていません</em>
    <blockquote>             
    Webアプリケーションが WARファイルから直接インストールされた場合は、
    現在のところ、アプリケーションの再ロード (クラスや <code>web.xml</code>
    ファイルの変更の反映) はサポートされません。
    再ロードはアーカイブされていないディレクトリから
    Webアプリケーションがインストールされた場合のみ有効です。
    WARファイルを使う場合、アプリケーションに変更を反映させるには、
    <code>配備解除</code> した上で再度 <code>配備</code> しなければなりません。
    </blockquote></li>       
</ul>

</subsection>

<primary>
<subsection name="List OS and JVM Properties"/>
</primary>
<subsection name="OS・JVMのプロパティの一覧表示">

<source>
http://localhost:8080/manager/serverinfo
</source>

<primary>
<p>Lists information about the Tomcat version, OS, and JVM properties.</p>
</primary>
<p>Tomcat のバージョン、OS、JVM プロパティに関する情報を一覧表示します。</p>

<primary>
<p>If an error occurs, the response will start with <code>FAIL</code> and
include an error message.  Possible causes for problems include:</p>
</primary>
<p>エラーが発生した場合、レスポンスは<code>失敗</code> で始まり、
エラーメッセージが表示されます。問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to enumerate the system properties.
    Check the Tomcat 5 logs for the details.</p>
    </blockquote></li>
</ul>
</primary>
<ul>
<li><em>例外が発生しました</em>
    <blockquote>             
    <p>Webアプリケーションの起動時に例外が発生しました。
    詳細については Tomcat 5 のログをチェックして下さい。</p>
    </blockquote></li>       
</ul>

</subsection>

<primary>
<subsection name="List Available Global JNDI Resources"/>
</primary>
<subsection name="利用可能なJNDIリソースの一覧表示">

<source>
http://localhost:8080/manager/resources[?type=xxxxx]
</source>

<primary>
<p>List the global JNDI resources that are available for use in resource
links for context configuration files.  If you specify the <code>type</code>
request parameter, the value must be the fully qualified Java class name of
the resource type you are interested in (for example, you would specify
<code>javax.sql.DataSource</code> to acquire the names of all available
JDBC data sources).  If you do not specify the <code>type</code> request
parameter, resources of all types will be returned.</p>
</primary>
<p>コンテキスト設定ファイルのリソースリンクで使用可能なグローバル 
JNDI リソースを一覧表示します。<code>type</code> リクエストパラメータを指定する場合、
その値は使用したいリソースタイプの完全修飾 Java クラス名でなければなりません
(例えば、使用可能なJDBC データソース名をすべて取得したい場合は、
<code>javax.sql.DataSource</code> と指定します)。<code>type</code> 
リクエストパラメータを指定しない場合は、すべてのリソースタイプが返されます。</p>

<primary>
<p>Depending on whether the <code>type</code> request parameter is specfied
or not, the first line of a normal response will be:</p>
</primary>
<p><code>type</code> リクエストパラメータが指定されていない場合、
正常なレスポンスの1行目は以下のようになります。</p>
<primary>
<pre>
  OK - Listed global resources of all types
</pre>
</primary>
<pre>
  成功 - すべてのタイプのグローバルリソースを列挙しました
</pre>
<primary>
<p>指定された場合は以下のようになります。</p>
</primary>
<p>or</p>
<primary>
<pre>
  OK - Listed global resources of type xxxxx
</pre>
</primary>
<pre>
  成功 - タイプ xxxxx のグローバルリソースを列挙しました
</pre>
<primary>
<p>followed by one line for each resource.  Each line is composed of fields
delimited by colon characters (":"), as follows:</p>
</primary>
<p>続いて各リソースが1行ずつ表示されます。
各行ではコロン (":") 区切りで以下の項目が表示されます</p>
<primary>
<ul>
<li><em>Global Resource Name</em> - The name of this global JNDI resource,
    which would be used in the <code>global</code> attribute of a
    <code>&lt;ResourceLink&gt;</code> element.</li>
<li><em>Global Resource Type</em> - The fully qualified Java class name of
    this global JNDI resource.</li>
</ul>
</primary>
<ul>
<li><em>グローバルリソース名</em> - グローバル JNDI リソース名。
    <code>&lt;ResourceLink&gt;</code> 要素の <code>global</code> 
    属性で使われます。</li>
<li><em>グローバルリソースタイプ</em> - グローバル JNDI リソースの完全修飾
    Java クラス名</li>
</ul>

<primary>
<p>If an error occurs, the response will start with <code>FAIL</code> and
include an error message.  Possible causes for problems include:</p>
</primary>
<p>エラーが発生した場合、レスポンスは<code>失敗</code> で始まり、
エラーメッセージが表示されます。問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to enumerate the global JNDI
    resources.  Check the Tomcat 5 logs for the details.</p>
    </blockquote></li>
<li><em>No global JNDI resources are available</em>
    <blockquote>
    <p>The Tomcat server you are running has been configured without
    global JNDI resources.</p>
    </blockquote></li>
</ul>
</primary>
<ul>
<li><em>例外が発生しました</em>
    <blockquote>             
    <p>Webアプリケーションの起動時に例外が発生しました。
    詳細については Tomcat 5 のログをチェックして下さい。</p>
    </blockquote></li>       
<li><em>失敗 - グローバルなJNDIリソースが利用できません</em>
    <blockquote>
    <p>この Tomcat サーバではグローバル JNDI リソースが使えないように設定されています。</p>
    </blockquote></li>
</ul>


</subsection>


<primary>
<subsection name="List Available Security Roles"/>
</primary>
<subsection name="利用可能なセキュリティロールの一覧表示">

<source>
http://localhost:8080/manager/roles
</source>

<primary>
<p>List the security role names (and corresponding descriptions) that are
available in the <code>org.apache.catalina.UserDatabase</code> resource that
is linked to the <code>users</code> resource reference in the web.xml file
for the Manager web application.  This would typically be used, for example,
by a deployment tool that wanted to create
<code>&lt;security-role-ref&gt;</code> elements to map security role names
used in a web application to the role names actually defined within the
container.</p>
</primary>
<p>Manager Webアプリケーションの web.xml ファイルの <code>users</code>
リソース参照にリンクした <code>org.apache.catalina.UserDatabase</code> 
リソースで使用可能なセキュリティロール名 (とその説明) を一覧表示します。
例えば Webアプリケーションで使用されているセキュリティロール名と、
コンテナで実際に定義されているロール名とを対応付ける
<code>&lt;security-role-ref&gt;</code> 要素を作成する配備ツールで使えます。</p>

<primary>
<p>By default, the <code>users</code> resource reference is pointed at the
global <code>UserDatabase</code> resource.  If you choose to utilize a
different user database per virtual host, you should modify the
<code>&lt;ResourceLink&gt;</code> element in the default
<code>manager.xml</code> context configuration file to point at the global
user database resource for this virtual host.</p>
</primary>
<p>デフォルトでは、<code>users</code> リソース参照はグローバルな
<code>UserDatabase</code> リソースを参照します。仮想ホストごとに別のユーザデータベースを使うことにする場合は、デフォルトの <code>manager.xml</code> 
コンテキスト設定ファイルの <code>&lt;ResourceLink&gt;</code> 要素を、
この仮想ホスト用のグローバルなユーザデータベースのリソースを参照するように変更しなければなりません。</p>

<primary>
<p>When this command is executed, the first line of the response will be:</p>
</primary>
<p>このコマンドが実行された場合、レスポンスの1行目は以下のようになります。</p>
<p>When this command is executed, the first line of the response will be:</p>
<primary>
<pre>
  OK - Listed security roles
</pre>
</primary>
<pre>
  成功 - セキュリティロールを列挙しました
</pre>
<primary>
<p>followed by one line for each security role.  Each line is composed of
fields delimited by colon characters (":") as follows:</p>
</primary>
<p>続いて各セキュリティロールが1行ずつ表示されます。
各行ではコロン (":") 区切りで以下の項目が表示されます</p>
<primary>
<ul>
<li><em>Security Role Name</em> - A security role name that is known to Tomcat
    in the user database.</li>
<li><em>Description</em> - Description of this security role (useful in
    creating user interfaces for selecting roles.</li>
</ul>
</primary>
<ul>
<li><em>セキュリティロール名</em> - ユーザデータベースで Tomcat 
    認識しているセキュリティロール名。</li>
<li><em>説明</em> - このセキュリティロールの説明 
    (ロールを選択するユーザインタフェースを作成する場合に便利です)。</li>
</ul>

<primary>
<p>If an error occurs, the response will start with <code>FAIL</code> and
include an error message.  Possible causes for problems include:</p>
</primary>
<p>エラーが発生した場合、レスポンスは<code>失敗</code> で始まり、
エラーメッセージが表示されます。問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Cannot resolve user database reference</em> - A JNDI error prevented
    the successful lookup of the <code>org.apache.catalina.UserDatabase</code>
    resource.  Check the Tomcat log files for a stack trace associated with
    this error.</li>
<li><em>No user database is available</em> - You have not configured a resource
    reference for the <code>users</code> resource that points at an
    appropriate user database instance.  Check your <code>manager.xml</code>
    file and ensure that you have created an appropriate
    <code>&lt;ResourceLink&gt;</code> or
    <code>&lt;ResourceParams&gt;</code> element for this resource.</li>
</ul>
</primary>
<ul>
<li><em>失敗 - ユーザデータベース参照を解決できません</em> - 
    <code>org.apache.catalina.UserDatabase</code> 
    リソースでの検索が失敗した場合の JNDI エラーです。Tomcat ログファイルで、
    このエラーに関連するスタックトレースをチェックして下さい。</li>
<li><em>失敗 - ユーザデータベースが利用できません</em> - <code>users</code> 
    リソース参照が正しいユーザデータベースのインスタンスを参照するように設定できていません。
    <code>manager.xml</code> ファイルをチェックし、このリソースについて
    <code>&lt;ResourceLink&gt;</code> または <code>&lt;ResourceParams&gt;</code>
    要素が正しいか確認して下さい。</li>
</ul>

</subsection>


<primary>
<subsection name="Session Statistics"/>
</primary>
<subsection name="セッション統計">

<source>
http://localhost:8080/manager/sessions?path=/examples
</source>

<primary>
<p>Display the default session timeout for a web application, and the
number of currently active sessions that fall within ten-minute ranges of
their actual timeout times.  For example, after restarting Tomcat and then
executing one of the JSP samples in the <code>/examples</code> web app,
you might get something like this:</p>
</primary>
<p>Webアプリケーションのデフォルトのセッションタイムアウトと、
現在アクティブなセッション数を実際のタイムアウト時間を基準に10分単位にグループ化して表示します。
例えば、Tomcat を再起動し、<code>/examples</code> Webアプリの JSP
サンプルの1つを実行した場合、以下のようになるでしょう。</p>
<primary>
<source>
OK - Session information for application at context path /examples
Default maximum session inactive interval 30 minutes
30 - &lt;40 minutes:1 sessions
</source>
</primary>
<source>
成功 - コンテキストパス /examples のアプリケーションのセッション情報です
デフォルトの最大セッション停止間隔は30分です
30 - &lt;40 分: 1 セッション
</source>

</subsection>


<primary>
<subsection name="Start an Existing Application"/>
</primary>
<subsection name="既存のアプリケーションの起動">

<source>
http://localhost:8080/manager/start?path=/examples
</source>

<primary>
<p>Signal a stopped application to restart, and make itself available again.
Stopping and starting is useful, for example, if the database required by
your application becomes temporarily unavailable.  It is usually better to
stop the web application that relies on this database rather than letting
users continuously encounter database exceptions.</p>
</primary>
<p>停止したアプリケーションに再起動を指示し、再び使用可能にします。
例えば、アプリケーションで必要なデータベースが一時的に使用不可になった場合、
停止・起動ができると便利です。たいていの場合、
このデータベースを使う Webアプリケーションを停止させた方が、
ユーザに対してデータベース例外を表示し続けるよりは良いでしょう。</p>

<primary>
<p>If this command succeeds, you will see a response like this:</p>
</primary>
<p>このコマンドが成功すると、以下のようなレスポンスが返ってきます。</p>
<primary>
<source>
OK - Started application at context path /examples
</source>
</primary>
<source>
成功 - コンテキストパス /examples でアプリケーションを起動しました
</source>

<primary>
<p>Otherwise, the response will start with <code>FAIL</code> and include an
error message.  Possible causes for problems include:</p>
</primary>
<p>そうでなければ、レスポンスは <code>失敗</code> で始まるエラーメッセージとなります。
問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to start the web application.
    Check the Tomcat 5 logs for the details.</p>
    </blockquote></li>
<li><em>Invalid context path was specified</em>
    <blockquote>
    <p>The context path must start with a slash character, unless you are
    referencing the ROOT web application -- in which case the context path
    must be a zero-length string.</p>
    </blockquote></li>
<li><em>No context exists for path /foo</em>
    <blockquote>
    <p>There is no deployed or installed application on the context path
    that you specified.</p>
    </blockquote></li>
<li><em>No context path was specified</em>
    <blockquote>
    The <code>path</code> parameter is required.
    </blockquote></li>
</ul>
</primary>
<ul>
<li><em>例外が発生しました</em>
    <blockquote>             
    <p>Webアプリケーションの起動時に例外が発生しました。
    詳細については Tomcat 5 のログをチェックして下さい。</p>
    </blockquote></li>       
<li><em>無効なコンテキストパスが指定されました</em>
    <blockquote>             
    <p>コンテキストパスはスラッシュ ("/") で始まらなければなりません。
    ROOT Webアプリケーションを参照している場合は例外です
    -- この場合は、コンテキストパスは長さ0の文字列になります。</p>
    </blockquote></li>       
<li><em>パス /foo のコンテキストが存在しません</em>
    <blockquote>             
    <p>指定したコンテキストのアプリケーションは配備されていません。</p>  
    </blockquote></li>       
<li><em>コンテキストパスが指定されていません</em>
    <blockquote>             
    <code>path</code> パラメータが必要です。
    </blockquote></li>       
</ul>

</subsection>

<primary>
<subsection name="Stop an Existing Application"/>
</primary>
<subsection name="既存のアプリケーションの停止">

<source>
http://localhost:8080/manager/stop?path=/examples
</source>

<primary>
<p>Signal an existing application to make itself unavailable, but leave it
deployed or installed.  Any request that comes in while an application is
stopped will see an HTTP error 404, and this application will show as
"stopped" on a list applications command.</p>
</primary>
<p>既存のアプリケーションを使用不可にするよう指示しますが、配備解除はしません。
アプリケーションが停止している時に送られたリクエストの結果はすべて、
HTTPエラー404となり、このアプリケーションは「アプリケーション一覧」コマンドでは
"stopped"と表示されます。</p>
<note>実際にブラウザで表示した場合、0バイトのレスポンスが返っているらしく、
何も表示されません。</note>

<primary>
<p>If this command succeeds, you will see a response like this:</p>
<source>
OK - Stopped application at context path /examples
</source>
</primary>
<p>このコマンドが成功すると、以下のようなレスポンスが返ってきます。</p>
<source>
成功 - コンテキストパス /examples でアプリケーションを停止しました
</source>

<primary>
<p>Otherwise, the response will start with <code>FAIL</code> and include an
error message.  Possible causes for problems include:</p>
</primary>
<p>そうでなければ、レスポンスは <code>失敗</code> で始まるエラーメッセージとなります。
問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to stop the web application.
    Check the Tomcat 5 logs for the details.</p>
    </blockquote></li>
<li><em>Invalid context path was specified</em>
    <blockquote>
    <p>The context path must start with a slash character, unless you are
    referencing the ROOT web application -- in which case the context path
    must be a zero-length string.</p>
    </blockquote></li>
<li><em>No context exists for path /foo</em>
    <blockquote>
    <p>There is no deployed or installed application on the context path
    that you specified.</p>
    </blockquote></li>
<li><em>No context path was specified</em>
    <blockquote>
    The <code>path</code> parameter is required.
    </blockquote></li>
</ul>
</primary>
<ul>
<li><em>例外が発生しました</em>
    <blockquote>             
    <p>Webアプリケーションの起動時に例外が発生しました。
    詳細については Tomcat 5 のログをチェックして下さい。</p>
    </blockquote></li>       
<li><em>無効なコンテキストパスが指定されました</em>
    <blockquote>             
    <p>コンテキストパスはスラッシュ ("/") で始まらなければなりません。
    ROOT Webアプリケーションを参照している場合は例外です
    -- この場合は、コンテキストパスは長さ0の文字列になります。</p>
    </blockquote></li>       
<li><em>パス /foo のコンテキストが存在しません</em>
    <blockquote>             
    <p>指定したコンテキストのアプリケーションは配備されていません。</p>  
    </blockquote></li>       
<li><em>コンテキストパスが指定されていません</em>
    <blockquote>             
    <code>path</code> パラメータが必要です。
    </blockquote></li>       
</ul>

</subsection>


<primary>
<subsection name="Undeploy an Existing Application"/>
</primary>
<subsection name="既存のアプリケーションの配備解除">

<source>
http://localhost:8080/manager/undeploy?path=/examples
</source>

<primary>
<p><strong><font color="red">WARNING</font> - This command will
delete the contents of the web application directory if it exists within the
<code>appBase</code> directory (typically "webapps") for this virtual host
</strong>.  This will also delete the source .WAR if expanding occurred, as
well as the XML Context definition. If you simply want to take an application
out of service, you should use the <code>/stop</code> command instead.</p>
</primary>
<p><strong><font color="red">警告</font> - このコマンドによって、
この仮想ホストの <code>appBase</code> ディレクトリ (通常は"webapps") 
内に存在する Webアプリケーションディレクトリの中身や".war"ファイル、
あるいはその両方が削除されます。</strong>
Webアプリケーションの一時的なワークディレクトリも削除されます。
アプリケーションのサービスを休止したいだけなら、
代わりに <code>/stop</code> コマンドを使うべきです。</p>

<primary>
<p>Signal an existing application to gracefully shut itself down, and
remove it from Tomcat (which also makes this context path available for
reuse later).  In addition, the document root directory is removed, if it
exists in the <code>appBase</code> directory (typically "webapps") for
this virtual host.  This command is the logical opposite of the
<code>/deploy</code> command.</p>
</primary>
<p>既存のアプリケーションを緩やかに (gracefully) シャットダウンし、
Tomcat から削除するよう指示します 
(またこれによって、このコンテキストパスは後で再利用可能となります)。
さらに、ドキュメントルートディレクトリが、この仮想ホストの <code>appBase</code>
ディレクトリ (通常は"webapps") 内に存在する場合、そのディレクトリも削除されます。
このコマンドは <code>/deploy</code> コマンドの反対です。</p>

<primary>
<p>If this command succeeds, you will see a response like this:</p>
</primary>
<p>このコマンドが成功すると、以下のようなレスポンスが返ってきます。</p>
<primary>
<source>
OK - Undeployed application at context path /examples
</source>
</primary>
<source>
成功 - コンテキストパス /examples のアプリケーションを配備解除しました
</source>

<primary>
<p>Otherwise, the response will start with <code>FAIL</code> and include an
error message.  Possible causes for problems include:</p>
</primary>
<p>そうでなければ、レスポンスは <code>失敗</code> で始まるエラーメッセージとなります。
問題の原因としては以下のものが考えられます。</p>
<primary>
<ul>
<li><em>Encountered exception</em>
    <blockquote>
    <p>An exception was encountered trying to undeploy the web application.
    Check the Tomcat 5 logs for the details.</p>
    </blockquote></li>
<li><em>Invalid context path was specified</em>
    <blockquote>
    <p>The context path must start with a slash character, unless you are
    referencing the ROOT web application -- in which case the context path
    must be a zero-length string.</p>
    </blockquote></li>
<li><em>No context exists for path /foo</em>
    <blockquote>
    <p>There is no deployed or installed application on the context path
    that you specified.</p>
    </blockquote></li>
<li><em>No context path was specified</em>
    <blockquote>
    The <code>path</code> parameter is required.
    </blockquote></li>
</ul>
</primary>
<ul>
<li><em>例外が発生しました</em>
    <blockquote>             
    <p>Webアプリケーションの起動時に例外が発生しました。
    詳細については Tomcat 5 のログをチェックして下さい。</p>
    </blockquote></li>       
<li><em>無効なコンテキストパスが指定されました</em>
    <blockquote>             
    <p>コンテキストパスはスラッシュ ("/") で始まらなければなりません。
    ROOT Webアプリケーションを参照している場合は例外です
    -- この場合は、コンテキストパスは長さ0の文字列になります。</p>
    </blockquote></li>       
<li><em>パス /foo のコンテキストが存在しません</em>
    <blockquote>             
    <p>指定したコンテキストのアプリケーションは配備・インストールされていません。</p>  
    </blockquote></li>       
<li><em>コンテキストパスが指定されていません</em>
    <blockquote>             
    <code>path</code> パラメータが必要です。
    </blockquote></li>       
</ul>

</subsection>

</section>


<primary>
<section name="Executing Manager Commands With Ant"/>
</primary>
<section name="AntでのManagerコマンドの実行">

<primary>
<p>In addition to the ability to execute Manager commands via HTTP requests,
as documented above, Tomcat 5 includes a convenient set of Task definitions
for the <em>Ant</em> (version 1.4 or later) build tool.  In order to use these
commands, you must perform the following setup operations:</p>
</primary>
<p>ここまでで説明した HTTP リクエストによる Manager コマンド実行の他に、
Tomcat 5 では ビルドツールの <em>Ant</em> (バージョン1.4以降) 
用の便利なタスク定義を用意しています。これらのコマンドを使うためには、
以下のセットアップを行なわなければなりません。</p>
<primary>
<ul>
<li>Download the binary distribution of Ant from
    <a href="http://jakarta.apache.org/ant/">http://jakarta.apache.org/ant</a>.
    You must use version <strong>1.4</strong> or later.</li>
<li>Install the Ant distribution in a convenient directory (called
    ANT_HOME in the remainder of these instructions).</li>
<li>Copy the file <code>server/lib/catalina-ant.jar</code> from your Tomcat 5
    installation into Ant's library directory (<code>$ANT_HOME/lib</code>).
    </li>
<li>Add the <code>$ANT_HOME/bin</code> directory to your <code>PATH</code>
    environment variable.</li>
<li>Configure at least one username/password combination in your Tomcat
    user database that includes the <code>manager</code> role.</li>
</ul>
</primary>
<ul>
<li>Ant のバイナリ配布を <a href="http://ant.apache.org/">http://ant.apache.org/</a>
    からダウンロードします。
    バージョン<strong>1.4</strong>以降を使用しなければなりません。</li>
<li>適当なディレクトリに Ant 配布をインストールします (以下の説明では、
    このディレクトリを $ANT_HOME と記述します).</li>
<li><code>server/lib/catalina-ant.jar</code> ファイルを Tomcat 5 
    のインストールディレクトリから Ant のライブラリディレクトリ 
    (<code>$ANT_HOME/lib</code>) にコピーします。
    </li>
<li><code>PATH</code> 環境変数に <code>$ANT_HOME/bin</code> を加えます。</li>
<li>Tomcat のユーザデータベースで <code>manager</code> ロールを持つ
    username/password の組み合わせを1種類以上設定します。</li>
</ul>
<note>訳についてはAntのURLを最新化しました。</note>

<primary>
<p>To use custom tasks within Ant, you must declare them first with a
<code>&lt;taskdef&gt;</code> element.  Therefore, your <code>build.xml</code>
file might look something like this:</p>
</primary>
<p>Ant でカスタムタスクを使うには、最初に <code>&lt;taskdef&gt;</code> 
要素を宣言しなければなりません。したがって <code>build.xml</code> 
の内容は以下のような感じになるでしょう。</p>

<primary>
<table border="1">
<tr><td><pre>
&lt;project name="My Application" default="compile" basedir="."&gt;

  &lt;!-- Configure the directory into which the web application is built --&gt;
  &lt;property name="build"    value="${basedir}/build"/&gt;

  &lt;!-- Configure the context path for this application --&gt;
  &lt;property name="path"     value="/myapp"/&gt;

  &lt;!-- Configure properties to access the Manager application --&gt;
  &lt;property name="url"      value="http://localhost:8080/manager"/&gt;
  &lt;property name="username" value="myusername"/&gt;
  &lt;property name="password" value="mypassword"/&gt;

  &lt;!-- Configure the custom Ant tasks for the Manager application --&gt;
  &lt;taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"/&gt;
  &lt;taskdef name="list"      classname="org.apache.catalina.ant.ListTask"/&gt;
  &lt;taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"/&gt;
  &lt;taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/&gt;
  &lt;taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"/&gt;
  &lt;taskdef name="start"     classname="org.apache.catalina.ant.StartTask"/&gt;
  &lt;taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"/&gt;
  &lt;taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"/&gt;

  &lt;!-- Executable Targets --&gt;
  &lt;target name="compile" description="Compile web application"&gt;
    &lt;!-- ... construct web application in ${build} subdirectory ... --&gt;
  &lt;/target&gt;

  &lt;target name="deploy" description="Install web application"
          depends="compile"&gt;
    &lt;deploy url="${url}" username="${username}" password="${password}"
            path="${path}" war="file://${build}"/&gt;
  &lt;/target&gt;

  &lt;target name="reload" description="Reload web application"
          depends="compile"&gt;
    &lt;reload  url="${url}" username="${username}" password="${password}"
            path="${path}"/&gt;
  &lt;/target&gt;

  &lt;target name="undeploy" description="Remove web application"&gt;
    &lt;remove url="${url}" username="${username}" password="${password}"
            path="${path}"/&gt;
  &lt;/target&gt;

&lt;/project&gt;
</pre></td></tr>
</table>
</primary>
<table border="1">
<tr><td><pre>
&lt;project name="My Application" default="compile" basedir="."&gt;

  &lt;!-- Webアプリケーションをビルドするディレクトリを設定します --&gt;
  &lt;property name="build"    value="${basedir}/build"/&gt;

  &lt;!-- このアプリケーションのコンテキストパスを設定します --&gt;
  &lt;property name="path"     value="/myapp"/&gt;

  &lt;!-- Manager アプリケーションにアクセスするプロパティを設定します --&gt;
  &lt;property name="url"      value="http://localhost:8080/manager"/&gt;
  &lt;property name="username" value="myusername"/&gt;
  &lt;property name="password" value="mypassword"/&gt;

  &lt;!-- Manager アプリケーション用のカスタム Ant タスクを設定します --&gt;
  &lt;taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"/&gt;
  &lt;taskdef name="list"      classname="org.apache.catalina.ant.ListTask"/&gt;
  &lt;taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"/&gt;
  &lt;taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/&gt;
  &lt;taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"/&gt;
  &lt;taskdef name="start"     classname="org.apache.catalina.ant.StartTask"/&gt;
  &lt;taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"/&gt;
  &lt;taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"/&gt;

  &lt;!-- 実行可能ターゲット --&gt;
  &lt;target name="compile" description="Webアプリケーションのコンパイル"&gt;
    &lt;!-- ... ${build} サブディレクトリで Webアプリケーションを構築 ... --&gt;
  &lt;/target&gt;

  &lt;target name="deploy" description="Webアプリケーションのインストール"
          depends="compile"&gt;
    &lt;deploy url="${url}" username="${username}" password="${password}"
            path="${path}" war="file://${build}"/&gt;
  &lt;/target&gt;

  &lt;target name="reload" description="Webアプリケーションのリロード"
          depends="compile"&gt;
    &lt;reload  url="${url}" username="${username}" password="${password}"
            path="${path}"/&gt;
  &lt;/target&gt;

  &lt;target name="undeploy" description="Webアプリケーションの削除"&gt;
    &lt;remove url="${url}" username="${username}" password="${password}"
            path="${path}"/&gt;
  &lt;/target&gt;

&lt;/project&gt;
</pre></td></tr>
</table>

<primary>
<p>Now, you can execute commands like <code>ant deploy</code> to deploy the
applcation to a running instance of Tomcat, or <code>ant reload</code> to
tell Tomcat to reload it.  Note also that most of the interesting values in
this <code>build.xml</code> file are defined as replaceable properties, so
you can override their values from the command line.  For example, you might
consider it a security risk to include the real manager password in your
<code>build.xml</code> file's source code.  To avoid this, omit the password
property, and specify it from the command line:</p>
</primary>
<p>これで、Tomcatの実行中のインスタンスに対してアプリケーションを配備するのに
<code>ant deploy</code> というコマンドを実行したり、Tomcat 
にリロードを指示するのに <code>ant reload</code> コマンドを実行できます。
注意：この <code>build.xml</code> の重要な値のほとんどは置換可能なプロパティとして定義されています。
したがって、これらの値はコマンドラインで上書きできます。例えば、
<code>build.xml</code> ファイルのソースコードに実際の <code>manager</code>
ロールを持つユーザーのパスワードを記述するのは、
セキュリティ上リスクがあると思うかもしれません。
それを回避するには、password プロパティに値を指定せずに、
コマンドラインで以下のように指定します。
</p>
<note>real manager passwordあたりは補足して訳しました。</note>

<pre>
  ant -Dpassword=secret deploy
</pre>

</section>

<primary>
<section name="Using the JMX Proxy Servlet"/>
</primary>
<section name="JMXプロキシサーブレットの使用">

<primary>
  <subsection name="What is JMX Proxy Servlet"/>
</primary>
  <subsection name="JMXプロキシサーブレットとは">
<primary>
    The JMX Proxy Servlet is a lightweight proxy to get and set the
    tomcat internals. (Or any class that has been exposed via an MBean)
    Its usage is not very user friendly but the UI is
    extremely help for integrating command line scripts for monitoring
    and changing the internals of tomcat. You can do two things with the proxy:
    get information and set information. For you to really understand the
    JMX Proxy Servlet, you should have a general understanding of JMX.
    If you don't know what JMX is, then prepare to be confused.
</primary>
    JMXプロキシサーブレットは　Tomcat の内部変数の取得・設定を行なう軽量のプロキシです
    (MBean で公開しているクラスの取得・設定も可能です)。
    使い方はあまりわかりやすくありませんが、
    このユーザインタフェースは、コマンドラインのスクリプトで
    Tomcat の内部変数を監視・変更できるようにするのに極めて役立ちます。
    プロキシでは、情報の取得と設定ができます。
    JMX プロキシサーブレットを正しく理解するためには、
    <a href="http://java.sun.com/products/JavaManagement/index.jsp">JMX 
    (Java Management Extensions)</a> の概要を理解しておく必要があります。
    JMX が何かご存知ない方はわかりにくいと思いますがご了承下さい。
    <note>原文にはありませんがSunのJMXページへのリンクをつけておきました。</note>
  </subsection>

<primary>
  <subsection name="JMX Query command"/>
</primary>
  <subsection name="JMXクエリコマンド">
<primary>
    This takes the form:
</primary>
    以下のような形式となります。
<source>
http://webserver/manager/jmxproxy/?qry=STUFF
</source>
<primary>
    Where <code>STUFF</code> is the JMX query you wish to perform. For example,
    here are some queries you might wish to run:
</primary>
    ここで <code>STUFF</code> は実行したい JMX クエリ (問い合わせ) を指します。例えば、
    以下のようなクエリを実行できます。
<primary>
    <ul>
      <li>
        <code>qry=*%3Atype%3DRequestProcessor%2C* -->
         type=RequestProcessor</code> which will locate all
         workers which can process requests and report
         their state.
      </li>
      <li>
        <code>qry=*%3Aj2eeType=Servlet%2c* -->
            j2eeType=Servlet</code> which return all loaded servlets.
      </li>
      <li>
        <code>qry=Catalina%3Atype%3DEnvironment%2Cresourcetype%3DGlobal%2Cname%3DsimpleValue -->
            Catalina:type=Environment,resourcetype=Global,name=simpleValue</code>
            which look for a specific MBean by the given name.
      </li>
    </ul>
</primary>
    <ul>
      <li>
        <code>qry=*%3Atype%3DRequestProcessor%2C* -->
         type=RequestProcessor</code> は、
         リクエスト処理可能なすべてのワーカを見つけ、状態を表示します。
      </li>
      <li>
        <code>qry=*%3Aj2eeType=Servlet%2c* -->
            j2eeType=Servlet</code> は、ロードされたすべてサーブレットを表示します。      </li>
      <li>
        <code>qry=Catalina%3Atype%3DEnvironment%2Cresourcetype%3DGlobal%2Cname%3DsimpleValue -->
            Catalina:type=Environment,resourcetype=Global,name=simpleValue</code>
            は、指定した名前の MBean を検索します。
      </li>
    </ul>
<primary>
    You'll need to experiment with this to really understand its capabilites.
    If you provide no <code>qry</code> parameter, then all of the MBeans will
    be displayed. We really recommend looking at the tomcat source code and
    understand the JMX spec to get a better understanding of all the queries
    you may run.
</primary>
    こうしたクエリでできることを本当に理解するためには、実際に試してみる必要があります。
    <code>qry</code> パラメータを指定しない場合、すべての MBean が表示されます。
    実際のところ、実行可能なクエリをすべて理解するには、
    Tomcatのソースコードを読み、JMX 仕様を理解することをお薦めします。
  </subsection>

<primary>
  <subsection name="JMX Set command"/>
</primary>
  <subsection name="JMX設定コマンド">
<primary>
    Now that you can query an MBean, its time to muck with Tomcat's internals!
    The general form of the set command is :
</primary>
    MBeanのクエリができるようになったら、
    こんどは Tomcat の内部変数を変えてみましょう。
    設定コマンドの通常の形式は以下の通りです。
<source>
http://webserver/manager/jmxproxy/?set=BEANNAME&amp;att=MYATTRIBUTE&amp;val=NEWVALUE
</source>
<primary>
    So you need to provide 3 request parameters:
    <ol>
      <li><code>set</code>: The full bean name</li>
      <li><code>att</code>: The attribute you wish to alter</li>
      <li><code>val</code>: The new value </li>
    </ol>
</primary>
    したがって、以下の3種類のリクエストパラメータを指定する必要があります。
    <ol>
      <li><code>set</code>: Beanのフルネーム</li>
      <li><code>att</code>: 変更したい属性</li>
      <li><code>val</code>: 変更後の値</li>
    </ol>
<primary>
    If all goes ok, then it will say OK, otherwise an error message will be
    shown. For example, lets say we wish to turn up debugging on the fly for the
    <code>ErrorReportValve</code>. The following will set debugging to 10.
</primary>
    すべてうまく行けば「成功」と出ますし、そうでなければエラーメッセージが出ます。
    例えば 実行中に<code>ErrorReportValve</code> 
    のデバッグ詳細レベルを上げたいとします。
    以下のコマンドでデバッグ詳細レベルが10に設定されます。
<source>
http://localhost:8080/manager/jmxproxy/
?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost&amp;att=debug&amp;val=10
</source>
<primary>
    and my result is (YMMV):
</primary>
    実行結果は例えば以下のようになります (環境によって異なります)。
<source>
Result: ok
</source>

<primary>
    Here is what I see if I pass in a bad value. Here is the URL I used,
    I try set debugging equal to 'cowbell':
</primary>
    次に誤った値を指定した場合の例を示します。
    デバッグ詳細レベルに「cowbell」と指定してみましょう。
<source>
http://localhost:8080/manager/jmxproxy/
?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost&amp;att=debug&amp;val=cowbell
</source>
<primary>
    When I try that, my result is
</primary>
    実行結果は例えば以下のようになります。
<source>
Error: java.lang.NumberFormatException: For input string: "cowbell"
</source>
  </subsection>


</section>



</body>

</document>
