Tomcat9 の manager の 「Server Status」「Manager App」にアクセスできません。
※403 Access Denied が表示されます。
※「Host Manager」にはアクセスできます。
■サーバ環境:
CentOS7
OpenJDK11
Tomcat 9 (9.0.30)
■設定内容:
アクセス環境を追加し、tomcat-users.xml にroleを下記のように追加しました。
対象ファイル:/opt/apache-tomcat/conf/tomcat-users.xml
<?xml version="1.0" encoding="UTF-8"?><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">
<role rolename="manager-gui"/> <role rolename="manager-status"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="admin-gui"/> <role rolename="admin-script"/> <user username="admin" password="password" roles="manager-gui,manager-status,manager-script,manager-jmx,admin-gui,admin-script"/> </tomcat-users>role 部分を他のパターンに書き換えてみましたが、同様に「Host Manager」のみアクセスでき、
「Server Status」「Manager App」にアクセスできません。
○パターン1
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
○パターン2
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="tomcat" password="s3cret" roles="tomcat"/>
<user username="both" password="s3cret" roles="tomcat,role1"/>
<user username="role1" password="s3cret" roles="role1"/>
<user username="manager" password="s3cret" roles="manager-gui,manager-status,manager-script,manager-jmx"/>
<user username="admin" password="s3cret" roles="admin-gui,admin-script"/>
■エラーメッセージ
403 Access Denied
You are not authorized to view this page.By default the Manager is only accessible from a browser running on the same machine as Tomcat. If > > you wish to modify this restriction, you'll need to edit the Manager's context.xml file.
If you have already configured the Manager application to allow access and you have used your browsers back button, used a saved book-mark or similar then you may have triggered the cross-site > request forgery (CSRF) protection that has been enabled for the HTML interface of the Manager application. You will need to reset this protection by returning to the main Manager page. Once you > return to this page, you will be able to continue using the Manager application's HTML interface normally. If you continue to see this access denied message, check that you have the necessary permissions to access this application.
If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.
For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the > following to the config file listed above.
<role rolename="manager-gui"/> <user username="tomcat" password="s3cret" roles="manager-gui"/> Note that for Tomcat 7 onwards, the roles required to use the manager application were changed from > the single manager role to the following four roles. You will need to assign the role(s) required for > the functionality you wish to access.
manager-gui - allows access to the HTML GUI and the status pages
manager-script - allows access to the text interface and the status pages
manager-jmx - allows access to the JMX proxy and the status pages
manager-status - allows access to the status pages only
The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the > CSRF protection:
Users with the manager-gui role should not be granted either the manager-script or manager-jmx roles.
If the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces > are intended for tools not humans) then the browser must be closed afterwards to terminate the > session.
For more information - please see the Manager App How-To.
どのように設定を変更したよろしいでしょうか。
恐れ入りますがアドバイス頂けますと幸いです。
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー