【问题标题】:TOMCAT - Cannot access manager appTOMCAT - 无法访问管理器应用程序
【发布时间】:2017-01-17 18:42:21
【问题描述】:

我知道其他时候有人问过这个问题,但我遵循了每一个建议但没有成功..

我使用 Ubuntu 在我的 AWS EC2 实例中安装了 Tomcat 8.5.5。 Tomcat 已启动并正在运行(我在 http://mywebsite.com:8080 看到了启动页面

当我尝试进入应用程序管理器时,我得到一个 HTTP 状态 404 - /manager/html(管理器应用程序存在于 /webapps 文件夹中)

我尝试编辑 server.xml 文件添加

<Realm className="org.apache.catalina.realm.MemoryRealm" />

然后我以这种方式更新了context.xml,将我的ip添加到了Connector

<Context antiResourceLocking="false" privileged="true" >
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow=2\.228\.86\.2|"127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
</Context>

我显然在 tomcat-users.xml 中添加了用户

<role rolename="manager-gui"/>
<role rolename="admin-gui">
<role rolename="manager-script"/>
<user username="system" password="xxxxxxxx" roles="manager-gui,admin-gui"/>
<user username="xxxxxxx" password="xxxxxxxx" roles="manager-script"/>

重启了tomcat...但是什么都没有...

【问题讨论】:

    标签: tomcat amazon-ec2


    【解决方案1】:

    您还必须将您的 IP 和“useIPVHost”添加到连接器元素。不要添加另一个连接器元素,而是编辑现有的:

    <Connector port="9009" protocol="AJP/1.3" redirectPort="9443" 
           address="2.228.86.2" useIPVHosts="true" />
    

    您不必像以前那样添加 MemoryRealm,只要您坚持使用您的 tomcat-users.xml 中定义的用户名/密码进行身份验证,它就应该与 UserDatabaserealm 一起使用

    更完整的描述见我的answer to a similar question

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-11
      • 1970-01-01
      • 2012-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多