2017-05-03 9 views
0

私は最近2つのTomcatサーバを設定しなければなりませんでした。私はバージョン8.5.13を使用して1つのTomcatサーバーをセットアップしました。サーバーステータス、マネージャーApp、ホストマネージャのWebインターフェイスに問題なくアクセスできます。tomcat管理インタフェースは403の禁じられたエラーを与えます

しかし、Tomcatバージョン8.5.14を実行している新しいTomcatサーバーを8.5.13サーバーからコピーして設定しようとしたとき、サーバーステータスとマネージャーアプリケーションでアクセスが拒否されました。しかし、不思議なことに、ホストマネージャのWebインターフェイスだけが正しく動作します。私はそれにアクセスすることができます。

私は最初のサーバで動作するのと同じ設定が、2番目のサーバで403が拒否される理由を理解する必要があります。

これは私がそれぞれに持っているものです:サーバーのJavaの作業

java version "1.8.0_121" 
Java(TM) SE Runtime Environment (build 1.8.0_121-b13) 
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) 

非作業サーバーは、新しいJavaのを持っている:他に

java version "1.8.0_131" 
Java(TM) SE Runtime Environment (build 1.8.0_131-b11) 
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) 

すべてがコンフィギュレーションの面で同じです。

JAVA_HOME='/usr/lib/jvm' 
CATALINA_HOME='/usr/local/tomcat' 

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL JAVA_HOME CATALINA_HOME 

両方のサーバーが第二非作業サーバに第一作業サーバーからコピーした同じ設定ファイルを、持っている:

どちらも、/ etc/profileをでJavaとTomcatの変数を設定しています。

Tomcatのユーザー設定:

cat /usr/local/tomcat/conf/tomcat-users.xml 
<tomcat-users> 
    <user username="admin" password="not_saying" roles="manager-gui,admin-gui"/> 
</tomcat-users> 

コンテキストコンフィギュレーションファイルは、このあります

cat /usr/local/tomcat/conf/context.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. 
--> 
<!-- The contents of this file will be loaded for each web application --> 
<Context antiResourceLocking="false" privileged="true" > 
<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" 
       allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> 
</Context> 

を、両方のTOMCATSのためのWebアプリケーション用のcontext.xmlの設定がこれを持っている:

cat /usr/local/tomcat/webapps/host-manager/META-INF/context.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. 
--> 
<Context antiResourceLocking="false" privileged="true" > 
<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" 
       allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> 
</Context> 

なぜTomcatサーバー1(バージョン8.5.13)が動作していて、サーバー2の新しいTomcatバージョン(8.5.14)が動作していませんか?

答えて

1

localhost以外のマシンからアクセスしようとしていて、manager/META-INF/context.xmlのRemoteAddrValveの制限をコメントアウトしていないことを確認できますか?ホストマネージャのcontext.xmlからスニペットを表示し、コメントアウトしてホストマネージャにアクセスできるとしますが、マネージャのwebappでも同じことを確認していません。

関連する問題