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


相关推荐

  • sftp端口改了ssh受影响吗_sftp端口号怎么查

    sftp端口改了ssh受影响吗_sftp端口号怎么查1.修改两个配置文件,添加一行vi/etc/ssh/ssh_configport端口号vi/etc/ssh/sshd_configport端口号2.重启sshd服务systemctlrestartsshd

    2022年9月14日
    0
  • android线程间通信的几种方法_Android线程间通信机制

    android线程间通信的几种方法_Android线程间通信机制讲解Handler机制的博文很多,我也看了很多,但说实话,在我对Handler几乎不怎么了解的情况下,每一篇文章我都没太看懂,看完之后脑子里还是充满了疑问。究其原因,是因为几乎每一篇文章一上来就开始深入Handler源码,使得在一些宏观的问题上还是充满疑问,如果你从来没接触过Handler,对一些基础的问题还充满疑问,那深入源码去探究根源肯定会有些吃力。下面,我就从一个初学者思考的角度,来讲一讲H…

    2022年10月7日
    0
  • Idea激活码最新教程2024.2.3版本,永久有效激活码,亲测可用,记得收藏

    Idea激活码最新教程2024.2.3版本,永久有效激活码,亲测可用,记得收藏Idea 激活码教程永久有效 2024 2 3 激活码教程 Windows 版永久激活 持续更新 Idea 激活码 2024 2 3 成功激活

    2025年5月30日
    0
  • TensorFlow2.0安装_tensorflow中run

    TensorFlow2.0安装_tensorflow中runTensorflow2.4.1前言Tensorflow简介Anaconda简介Anaconda安装TensorFlowCPU&GPUTensorflow安装Pycharm&TensorflowTensorflow&HelloworldHelloworldSession()后序前言目前考虑进入梦寐以求的机器学习、人工智能等领域的学习,因此安装主流的机器学习框架Tensorflow迫在眉睫。然而网上的网上安装教程大多是1.xx版本的。目前安装的环境

    2022年8月27日
    3
  • 代理模式(proxy)

    前言 代理模式是一个大类,而且会经常用到,它包含了远程代理,虚拟代理,防火墙代理等,当然还有动态代理了,学过spring的人应该不陌生。 各种代理模式样式差别很大,不容易从程序上辨认,但是可以从功能上认出来,今天我就举个例子聊聊代理模式最基本的样子,从例子中认识代理模式。 举例为静态代理的基本应用,稍后再介绍代理模式的一些特点。  情境引入      本次我们以滴滴为例…

    2022年4月4日
    40

发表回复

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

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