■ 設定
設定環境
* OS : Windows10
* Java : Java v1.8.0-b132
* Tomcat : Apache Tomcat v9.0.0.M26
設定手順
[1] $CATALINA_HOME/conf/tomcat-users.xml にユーザを追加する
=> 以下「【設定例】$CATALINA_HOME/conf/tomcat-users.xml」の「修正後」を参照のこと。
[2] $CATALINA_HOME/bin/setenv.bat (Linuxならsetenv.sh) を作成し、
以下「【設定例2】setenv」の内容を保存
[3] 以下のサイトから最新のwarファイル「probe.war」を、
$CATALINA_HOME/webapps配下に置く
https://github.com/psi-probe/psi-probe/releases
[4] Tomcat を(再)起動
[4] ブラウザで以下のアドレス(デフォルト設定時)にアクセスする
=> 認証ダイアログが表示されるので、
[1]で設定したユーザ名、パスワード(今回は「tomcat」「password」)を入力し、OKボタン押下
=> 「Tomcat Webアプリケーションマネージャ」画面が表示されればOK!
[[
http://localhost:8080/probe/]]
$CATALINA_HOME/conf/tomcat-users.xml
* 設定例として、Webアプリケーションマネージャのユーザ名、パスワード、ルールを以下のように設定
ユーザ名 :tomcat
パスワード:password
ルール :manager-gui
修正前
・・・略・・・
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
・・・略・・・
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
</tomcat-users>
修正後
・・・略・・・
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
・・・略・・・
<!-- Add -->
<role rolename="probeuser" />
<role rolename="poweruser" />
<role rolename="poweruserplus" />
<role rolename="manager-gui"/>
<user username="tomcat" password="password" roles="manager-gui"/>
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
</tomcat-users>
【設定例2】setenv
$CATALINA_HOME/bin/setenv.sh (Linux)
#!/bin/sh
CATALINA_OPTS="com.sun.management.jmxremote=true"
$CATALINA_HOME/bin/setenv.bat (Windows)
set CATALINA_OPTS=-Dcom.sun.management.jmxremote=true