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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • pycharm如何创建flask项目_适合flask的前端框架

    pycharm如何创建flask项目_适合flask的前端框架在网上看了很多办法,大都是用用命令行来实现,而且对Windows用户很不友好。其实只要在settings中选择projectinterpreter,再在右边点击+,再搜索flask选择第一个进行install就可以了,pycharm还会帮你装上所需要的其他插件第一篇博客,大家觉得有用的话给个赞可好你好!这是你第一次使用Markdown编辑器所展示的欢迎页。如果你想学习如何使用Mar…

    2022年8月29日
    2
  • java 错误:非法字符:“\ufeff”

    java 错误:非法字符:“\ufeff”java 错误:非法字符:“\ufeff”

    2022年4月25日
    53
  • 论latex插入图片最好的方法!

    论latex插入图片最好的方法!在写过几篇论文后总结出来的一些写论文新手都会遇到的插入图片问题的最高效的解决方法,这是本人在摸索了很多次以后总结出来的方法希望后人可以少走些弯路。毕竟这种小问题读研的时候老师师兄师姐都不会告诉你的都是要靠你自己去解决的。

    2022年6月1日
    41
  • 无刷直流电机simulink模型(ansoft电机仿真教程)

    这段时间刚开始接触Matlab中的Simulink仿真,我就结合自己的专业,利用Simulink进行了无刷直流电机的仿真,因为Simulink工具箱里面有很多可用的模块,所以建模过程变得非常简单。在Matlab界面中new->model之后,找到SimulinkLibraryBrowser,这里面有系统自带的很多模块,接下来我们就需要找到自己所需要的模块了,了解无刷直流电机的工作原理以后…

    2022年4月11日
    57
  • python 使用PyQt5

    python 使用PyQt5

    2021年7月1日
    84
  • 创建选区快捷键是什么_Photoshop选区操作的快捷键

    创建选区快捷键是什么_Photoshop选区操作的快捷键1.使用快捷键快速操作.F1-帮助F2-剪切F3-拷贝F4-粘贴F5-隐藏/显示画笔面板F6-隐藏/显示颜色面板F7-隐藏/显示图层面板F8-隐藏/显示信息面板F9-隐藏/显示动作面板F12-恢复Shift+f5-填充Shift+f6-羽化Shift+f7-选择→反选ctrl+h-隐藏选定区域ctrl+d-取消选定区域ctrl+w-关闭文件ctrl+Q-退出PHOTOSHOPEsc-取消操作…

    2022年6月15日
    75

发表回复

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

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