tomcat部署war包不成功解决方法

tomcat部署war包不成功解决方法今天尝试在阿里云服务器中的tomcat部署项目点击managerApp时页面显示这样,根据上图提示可知原因是cont/tomcat-users.xml未配置用户名和密码,所以需要将下面这段配置用户名和密码的代码添加到tomcat-users.xml中<rolerolename=”manager-gui”/><userusername=”tomcat”password=”tomcat”roles=”manager-gui”/>保存后重启tomcat,再点

大家好,又见面了,我是你们的朋友全栈君。

今天尝试在阿里云服务器中的tomcat部署项目
在这里插入图片描述

在这里插入图片描述
点击manager App 时页面显示这样,根据上图提示可知原因是cont/tomcat-users.xml 未配置用户名和密码, 所以需要将下面这段配置用户名和密码的代码添加到tomcat-users.xml中

<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>

在这里插入图片描述

保存后重启tomcat,再点击manage app 后提示输入
账号:tomcat
密码:tomcat 即可打开网址
在这里插入图片描述

若出现了403问题,则是因为访问受限了

403 Access Denied
 
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.
 
If you have already configured the 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 Manager application. You will need to reset this protection by returning to the main Manager page. Once you return to this page, you will be able to continue using the 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 manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above

这时候需要修改
/webapps/manager/META_INF/context.xml文件,将文件中对访问的来源受限设置注释:

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

修改后再重新点击Manage App 即可打开管理界面

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/138888.html原文链接:https://javaforall.net

(0)
上一篇 2022年5月30日 下午6:00
下一篇 2022年5月30日 下午6:00


相关推荐

  • 阿里字体图标的使用

    阿里字体图标的使用阿里字体图标的使用

    2026年3月26日
    3
  • Ajax面试题

    Ajax面试题前端面试题 Ajax 关于 Ajax 的技术面试问题 我遇到的也不多 我面试问到的都在这里了 哈哈 什么是 Ajax Ajax Asynchronous XML 即异步 JavaScript XML 的缩写 主要用来页面异步刷新 也是构建 RIA 的一种基础技术 Ajax 的实现流程是怎样的 1 创建 XMLHttpReque 对象 也就是创建一个异步调用对象

    2026年3月27日
    1
  • dlopen 介绍

    dlopen 介绍dlopen nbsp 介绍 includevoid dlopen constchar filename intflag char dlerror void void dlsym void handle constchar symbol intdlclose void handle 打开一个动态链接库 并返回动态链接库的句柄 flag

    2026年3月19日
    2
  • python3.8安装scrapy_python为什么叫爬虫

    python3.8安装scrapy_python为什么叫爬虫安装Scrapy与安装其他Python包没有区别,同样使用如下命令来安装:pipinstallscrapy如果在命令行窗口中运行该命令,将会看到程序并不立即下载、安装Scrapy,而是不断地下载大量第三方包。如果在命令行窗口中提示找不到pip命令,则也可以通过python命令运行pip模块来安装Scrapy,例如python-mpipinstallscrapy…

    2026年1月15日
    4
  • 激光slam与视觉slam优缺点_摄影光学与镜头

    激光slam与视觉slam优缺点_摄影光学与镜头介绍Slam:同步定位与建图,就是在定位的同时,建立环境地图。主要思路是根据运动学模型计算位姿,并通过传感得到的环境信息,对估计位姿调整优化,从而得到准确位姿,根据定位及感知数据绘制地图。下图为slam主流框架:传感器感知*在视觉SLAM中主要为传感信息的读取和预处理。前端里程计(Radar/VisualOdometry)。特征点匹配及运动估计。后端优化(Optimization)。后端接受不同时刻里程计测量位姿,以及回环检测的信息,对估计轨迹及环境信息进行全局优化。回环检测(Loop

    2022年8月23日
    13
  • VLAN基础知识_vlan的基本原理

    VLAN基础知识_vlan的基本原理VLAN简介定义:VLAN(VirtualLocalAreaNetwork)即虚拟局域网,是将一个物理的LAN在逻辑上划分成多个广播域的通信技术。VLAN内的主机间可以直接通信,而VLAN间不能直接通信,从而将广播报文限制在一个VLAN内。目的:以太网是一种基于CSMA/CD(CarrierSenseMultipleAccess/CollisionDetect…

    2022年8月10日
    10

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号