質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Tomcat

TomcatはApache Software Foundation (ASF)で開発されたオープンソースのWebコンテナです。

Q&A

7回答

26141閲覧

[Tomcat8]Tomcatマネージャの表示方法

dthani

総合スコア131

Tomcat

TomcatはApache Software Foundation (ASF)で開発されたオープンソースのWebコンテナです。

1グッド

2クリップ

投稿2016/08/03 02:42

編集2016/08/03 03:06

Tomcat8.5.3(CentOS6)で、Tomcatマネージャを表示させようと思い、
http://maruta.be/naniwan/32
上記サイトの通り、

tomcat-users.xmlで、<tomcat-users></tomcat-users>の間に
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>

を追記してtomcatを再起動したのですが、
「403 Access Denied」でTomcatマネージャが開きません。

他に設定箇所等があるのでしょうか?
ご存知の方、お教えください。

下記、tomcat-users.xmlの中身です

<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <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. --> <!-- NOTE: The sample user and role entries below are intended for use with the examples web application. They are wrapped in a comment and thus are ignored when reading this file. If you wish to configure these users for use with the examples web application, do not forget to remove the <!.. ..> that surrounds them. You will also need to set the passwords to something appropriate. --> <!-- <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"/> --> <role rolename="manager-gui"/> <user username="tomcat" password="s3cret" roles="manager-gui"/> </tomcat-users>
A-pZ👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

stmkza

2016/08/03 02:58

tomcat-users.xmlを貼ってください。(```xml ~ ```で囲って)
guest

回答7

0

同じ問題に当たって調べていたらここにたどり着きましたが、解決はされたでしょうか?
CATALINA_HOME/webapps/manager/META-INF/context.xml
の中にある
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
この条件に引っかかるとこれまでの設定ではうまくいかないと思います。
この条件を編集するか、すべてコメントアウトすることで表示されるかもしれません。

中途半端な回答で申し訳ありません、、

投稿2016/09/19 15:38

編集2016/09/19 15:56
wing3298

総合スコア13

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

dthani

2016/09/20 01:56

ご回答ありがとうございます。 結局、上手く行かず、下位バージョンtomcat8.0.36を試したところ、 tomcatマネージャが開いたので、そのバージョンを使用しています。
guest

0

tomcat-users.xmlのコメントの部分に書いているのかもしれません。
tomcat-users.xml全体を質問に貼ってください。

投稿2016/08/03 02:57

stmkza

総合スコア478

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

dthani

2016/08/03 03:07

ご回答ありがとうございます。 tomcat-users.xml全体を質問に貼り付けました。
guest

0

下記サイトのとおりに$CATALINA_HOME/conf/Catalina/localhostにmanager.xmlを作成して再起動したら見れました。
http://stackoverflow.com/questions/38172756/apache-tomcat-8-5-3-manager-app-403-error

投稿2016/10/12 14:12

next-evolution

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

管理画面にはサーバーからアクセスしていますか?それとも別のパソコンからアクセスしていますか?
別のパソコンからの場合はサーバーからアクセスしてみてください。

投稿2016/08/03 04:38

stmkza

総合スコア478

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

dthani

2016/08/03 05:35

管理画面は別のパソコンからアクセスしています。 サーバーはXwindowを入れていないため、サーバーで見ることはできません。
stmkza

2016/08/03 05:39 編集

html.xmlかmanager.xml(/conf/Catalinaか、そのサブディレクトリに入ってる) があったら、内容を質問に追記してください。
dthani

2016/08/03 05:45

すみません、html.xml, manager.xmlともにありません。 ※tomcat-userx.xmlを回答の方に書いた理由は質問の文字制限が超えたためです。
guest

0

tomcat-users.xmlを

xml

1<?xml version='1.0' encoding='utf-8'?> 2<!-- 3 Licensed to the Apache Software Foundation (ASF) under one or more 4 contributor license agreements. See the NOTICE file distributed with 5 this work for additional information regarding copyright ownership. 6 The ASF licenses this file to You under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with 8 the License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 17--> 18<tomcat-users xmlns="http://tomcat.apache.org/xml" 19 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 20 xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" 21 version="1.0"> 22<role rolename="manager-gui" /> 23<role rolename="admin-gui" /> 24<user username="tomcat" password="s3cret" roles="manager-gui,admin-gui" /> 25<!-- 26 NOTE: By default, no user is included in the "manager-gui" role required 27 to operate the "/manager/html" web application. If you wish to use this app, 28 you must define such a user - the username and password are arbitrary. It is 29 strongly recommended that you do NOT use one of the users in the commented out 30 section below since they are intended for use with the examples web 31 application. 32--> 33<!-- 34 NOTE: The sample user and role entries below are intended for use with the 35 examples web application. They are wrapped in a comment and thus are ignored 36 when reading this file. If you wish to configure these users for use with the 37 examples web application, do not forget to remove the <!.. ..> that surrounds 38 them. You will also need to set the passwords to something appropriate. 39--> 40<!-- 41 <role rolename="tomcat"/> 42 <role rolename="role1"/> 43 <user username="tomcat" password="<must-be-changed>" roles="tomcat"/> 44 <user username="both" password="<must-be-changed>" roles="tomcat,role1"/> 45 <user username="role1" password="<must-be-changed>" roles="role1"/> 46--> 47</tomcat-users> 48

のようにしてみたらどうでしょうか

投稿2016/08/03 04:27

編集2016/08/03 04:28
stmkza

総合スコア478

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

dthani

2016/08/03 05:33

上記の通り、設定しましたが上手く行きませんでした。
guest

0

今気づきましたが、Tomcatを再起動しましたか?してないならしてください。

投稿2016/08/03 03:20

stmkza

総合スコア478

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

dthani

2016/08/03 03:40

再起動はしています。
guest

0

どこにアクセスしていますか?
本当に /manager/html にアクセスしているか確認してください。
あとポートもあっているかなど
あと、それが本当にconf/tomcat-users.xmlかどうかも確認してください。

投稿2016/08/03 03:10

編集2016/08/03 03:12
stmkza

総合スコア478

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

dthani

2016/08/03 03:17

http://[サーバーのIP]:8080/ で、Tomcatの画面が開き、Manager Appのボタンをクリックすると、 http://[サーバーのIP]:8080/manager/html が開くのですが、「403 Access Denied」と出ます。 ポートは8080で問題ありません。
stmkza

2016/08/03 03:18

そこで認証のダイアログが出ませんでしたか?
dthani

2016/08/03 03:40

認証のダイアログは出ていません。
stmkza

2016/08/03 03:47

それでは、server.xmlも見せてくれませんか?
dthani

2016/08/03 04:05

<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <!-- Security listener. Documentation at /docs/config/listeners.html <Listener className="org.apache.catalina.security.SecurityListener" /> --> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <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> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 This connector uses the NIO implementation with the JSSE engine. When using the JSSE engine, the JSSE configuration attributes must be used. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="conf/localhost-rsa.jks" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2 This connector uses the APR/native implementation. When using the APR/native implementation or the OpenSSL engine with NIO or NIO2 then the OpenSSL configuration attributes must be used. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true" > <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <SSLHostConfig> <Certificate certificateKeyFile="conf/localhost-rsa-key.pem" certificateFile="conf/localhost-rsa-cert.pem" certificateChainFile="conf/localhost-rsa-chain.pem" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" /> </Host> </Engine> </Service> </Server>
dthani

2016/08/03 04:06

上記、server.xmlを貼り付けました。 因みにserver.xmlは何も変えておりません。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問