Skip to content

Instantly share code, notes, and snippets.

@tokunami
Last active October 29, 2020 08:59
Show Gist options
  • Save tokunami/e9e12f1f24ba75a68fbf to your computer and use it in GitHub Desktop.
Save tokunami/e9e12f1f24ba75a68fbf to your computer and use it in GitHub Desktop.

Tomcat7のユーザ設定

使うかわからないけど、、、

Tomcatのデフォルトページ http://localhost:8080 にあるボタン「Server Status」、「Manager App」、「HostManager」ボタンから入る管理者画面にアクセスするための設定

/usr/local/apache-tomcat-7.0.57/conf/tomcat-users.xmlを以下の要領で編集する

<?xml version='1.0' encoding='utf-8'?>
<!--
  ・・・
-->
<tomcat-users>
<role rolename="manager-gui"/>
<user username="<username>" password="<password>" roles="manager-gui"/>
<!--
  ・・・
-->
</tomcat-users>

編集後、Tomcatを再起動し、上述のデフォルトページにあるボタンをクリック
⇒ BASIC認証のダイアログが出るので指定したユーザ名、パスワードを入力すれば入れる

rolename一覧

rolename role
manager-gui allows access to the HTML GUI and the status pages
manager-status allows access to the status pages only
manager-script allows access to the text interface and the status pages
manager-jmx allows access to the JMX proxy and the status pages
admin-gui allows access to the HTML GUI
admin-script allows access to the text interface
@tokunami
Copy link
Author

rolenameはTomcat7から変更になったらしい。
過去バージョンのTomcatでは使えないので注意

@tokunami
Copy link
Author

「Server Status」ボタン ⇒ ユーザー「manager」を利用
「Manager App」ボタン ⇒ ユーザー「manager」を利用
「Host Manager」ボタン ⇒ ユーザー「admin」を利用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment