Tomcat 10の使い方¶
セットアップ¶
MacOS¶
MacOS上でHomebrewを利用したインストールとセットアップを記述します。
- インストールは、HomebrewでTomcatのインストールを参照
起動・終了¶
ターミナルでコンソールモードでの起動方法¶
ターミナルを開いて、次のコマンドで起動します。
% /opt/homebrew/opt/tomcat/bin/catalina run
終了は、ターミナルで Ctrl+C です。
サービス(デーモン)での起動方法¶
Homebrewは、サービスとして起動・終了できる機能を有しています。
% brew services list Name Status User File tomcat none unbound none
サービスとして起動する
% brew services start tomcat ==> Successfully started `tomcat` (label: homebrew.mxcl.tomcat)
起動状況の確認
% brew services list Name Status User File tomcat started TTakahashi ~/Library/LaunchAgents/homebrew.mxcl.tomcat.plist unbound none
サービスとして起動したtomcatを終了する
% brew services stop tomcat Stopping `tomcat`... (might take a while) ==> Successfully stopped `tomcat` (label: homebrew.mxcl.tomcat)
設定¶
管理アカウントの設定¶
/opt/homebrew/opt/tomcat/libexec/conf/ (または/opt/homebrew/etc/tomcat/)にある tomcat-users.xml を編集します。
管理GUIの使用設定¶
tomcat-users.xml の次のコメントを解除し、パスワードを記述します。
<!--
<user username="admin" password="<must-be-changed>" roles="manager-gui"/>
<user username="robot" password="<must-be-changed>" roles="manager-script"/>
-->