11
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TomcatのManager画面にログインできない

Last updated at Posted at 2018-03-01

tomcat-users.xml の設定

tomcat-users.xml
<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <user username="tomcat" password="p@ssw0rd" roles="manager-gui,admin-gui"/>
</tomcat-users>

401 Unauthorized となってしまう!

tomcat-users.xml に role, user 記載したのにログインできない!!

無題.jpg

server.xml も設定が必要!

server.xmlの、GlobalNamingResources で tomcat-users.xmlファイル を参照する設定も必要!

server.xml
...
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />           
  </GlobalNamingResources>
...
  • デフォルトでコメントアウトされているので、コメントアウトを外しましょう
  • Tomcatの再起動も忘れずに...

無事ログインできました。
OK.jpg

参考

Tomcatの管理者権限アカウント設定の方法
TOMCATで設定するBASIC認証の失敗する原因

11
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?