You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Tomcat 10.1.25 Manager页面无法访问求助(RHEL 9环境)

Tomcat 10.1.25无法访问/manager/html及内部链接的问题求助

我在RHEL 9系统上部署了Tomcat 10.1.25,目前可以正常通过本地和远程访问http://localhost:8080主页,但无法访问http://localhost:8080/manager/html页面(本地浏览器、curl工具均尝试过),且主页上的所有内部链接(如/docs/*)均返回403或401错误。我的最终目标是实现远程访问管理页面,但当前优先解决本地访问的问题。

错误提示信息

403错误内容:

"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."

401错误内容:

You are not authorized to view this page. 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.

当前配置文件

tomcat-users.xml

<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"/>
  <user username="fakeuser" password="fakepass" roles="manager-gui"/>
<tomcat-users/>

webapps/manager/META-INF/context.xml

<Context antiResourceLocking="false" privileged="true" >
  <CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"
                   sameSiteCookies="strict" />
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>

已尝试的操作

  • 注释掉context.xml中的<Valve className="org.apache.catalina.valves.RemoteAddrValve"...配置段
  • 修改allow属性值为127.\d+.\d+.\d+|::1|我的IP、单独的我的IP、*、.*
  • 在tomcat-users.xml中添加admin-gui角色并赋予用户
  • 对webapps/host-manager/META-INF/context.xml执行与manager相同的配置修改
  • 每次修改配置后均重启Tomcat并验证服务运行状态
  • 尝试通过HTTPS协议访问管理页面
  • 使用http://本地IP:8080/manager/html地址进行访问

已查阅所有能找到的相关资料,但问题仍未解决,希望得到可行的排查思路或解决方案。

内容的提问来源于stack exchange,提问作者Mark Smith

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 13:55:21