当前位置: 首页 > news >正文

Tomcat的Host Manager页面403的原因和解决办法

目录

背景

原因:

解决方案


背景

一直报错

403 Access Denied
You are not authorized to view this page.By default the Host 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 Host Manager's context.xml file.If you have already configured the Host 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 Host Manager application. You will need to reset this protection by returning to the main Host Manager page. Once you return to this page, you will be able to continue using the Host 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 admin-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.<role rolename="admin-gui"/>
<user username="tomcat" password="s3cret" roles="admin-gui"/>
Note that for Tomcat 7 onwards, the roles required to use the host manager application were changed from the single admin role to the following two roles. You will need to assign the role(s) required for the functionality you wish to access.admin-gui - allows access to the HTML GUI
admin-script - allows access to the text interface
The HTML interface is protected against CSRF but the text interface is not. To maintain the CSRF protection:Users with the admin-gui role should not be granted the admin-script role.
If the text interface is accessed through a browser (e.g. for testing since this interface is intended for tools not humans) then the browser must be closed afterwards to terminate the session.

原因:

ip限制,只能tomcat所在本机访问



解决方案

修改/webapps/manager/META-INF/context.xml

修改/webapps/host-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" />

或者修改为

  <Valve className="org.apache.catalina.valves.RemoteAddrValve"allow="^.*$" />

http://www.lryc.cn/news/322122.html

相关文章:

  • 零基础学华为ip认证难吗?华为认证费用多少?
  • [C语言]——内存函数
  • QGIS编译(跨平台编译)056:PDAL编译(Windows、Linux、MacOS环境下编译)
  • 计算机三级——网络技术(综合题第二题)
  • Python 深度学习第二版(GPT 重译)(二)
  • 【Redis】Redis常见原理和数据结构
  • 3个Tips,用“AI”开启新生活
  • 【ROS | OpenCV】在ROS中实现多版本OpenCV、cv_bridge共存:安装与配置指南
  • Docker容器化技术(docker-compose示例:部署discuz论坛和wordpress博客,使用adminer管理数据库)
  • 微分学<6>——Taylor公式
  • 检索增强生成(RAG)应用的构建:LangChain与LlamaIndex的比较与选择
  • 免费PDF转换和编辑工具 PDFgear 2.1.4
  • uniapp,导航栏(切换项)有多项,溢出采取左滑右滑的形式展示
  • 计算机网络面经-什么是IPv4和IPv6?
  • 彻底讲透:如何写sql能够有效的使用到复合索引?
  • 在Spring Boot中如何处理跨域请求(CORS)?
  • 好就业三种专业#信息安全#云计算#网络工程
  • electron-builder打包
  • SQLiteC/C++接口详细介绍sqlite3_stmt类(四)
  • 微信小程序自定义组件
  • python练习3
  • docker离线安装并修改存储目录
  • 【云原生 • Kubernetes】认识 k8s、k8s 架构、核心实战
  • 墨菲安全在软件供应链安全领域阶段性总结及思考
  • 智慧公厕:卫生、便捷、安全的新时代厕所变革
  • Idea 不能创建JDK1.8的spring boot项目
  • 【docker】Docker学习收集
  • LoRa模块在野外科研与环境保护中的角色:科技守护自然之宝
  • 全国媒体公关服务资源分析,媒体邀约资源包括哪些?-51媒体网
  • 【Springboot3+Mybatis】文件上传阿里云OSS 基础管理系统CRUD