管理tomcat的时候遇到了以下问题:

1.刚开始需要用户名密码,不知道用户名和密码是什么,但是输入什么都不正确。

  解决办法: 

自己在tomcat-users.xml中按格式添加用户 conf文件夹里面
默认是注释掉了的,这主要是考虑到服务器的安全,如果是本地测试,去掉以下这段注释,然后重启动服务器,再输入
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
用户和密码都一目了然了。

2..进入manager界面之后,显示的是403 Access Denied。

解决办法:
在conf/tomcat-users.xml文件中看到这么一段话:
NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary.
也就是说,为了考虑安全,tomcat默认还是没有manager-gui的管理权限的,如果想要使用manager的话,需要自行加入管理权限(角色)。需要加一个这样的权限(角色)
<role rolename="manager-gui"/>
然后再加到需要的用户名中去
<user username="tomcat" password="tomcat" roles="tomcat,manager-gui"/>
这样OK了。
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
--> <!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="ming" password="064417" roles="manager-gui,admin-gui"/>

</tomcat-users>

tomcat的管理(manager)报错403的更多相关文章

  1. Tomcat上传文件报错:returned a response status of 403 Forbidden

    出现这样的错误是没有权限对服务器进行写操作.需要在这个项目所在的tomcat中配置可写操作即可: 在tomcat的web.xml添加下面代码: <init-param><param- ...

  2. Windows 8.1升级至Windows 10后,启动VisualSVN Server Manager报错:提供程序无法执行所尝试的操作 (0x80041024)的解决

    1.1.Windows 8.1升级至Windows 10后,启动VisualSVN Server Manager报错:提供程序无法执行所尝试的操作 (0x80041024),VisualSVN Ser ...

  3. windows平台在tomcat中启动cas报错解决

    windows平台在tomcat中启动cas报错: Caused by: java.lang.UnsatisfiedLinkError: Could not load library. Reasons ...

  4. tomcat maven插件启动报错tomcat-users.xml cannot be read

    tomcat maven插件启动报错tomcat-users.xml cannot be read [ERROR] Failed to execute goal org.codehaus.mojo:t ...

  5. 移动tomcat ,eclipse启动报错原因

    报错:错误路径Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist. 1 ...

  6. Tomcat 启动时项目报错 org.springframework.beans.factory.BeanCreationException

    事情是这样的,最近我们公司需要将开发环境和测试环境分开,所以就需要把所有的项目部署一套新的开发环境. 我们都是通过 Jenkins 进行部署的,先说一下两个环境的配置: 测试环境配置(旧):jdk1. ...

  7. nginx 启动报错403

    nginx 安装完成以后启动的时候报403, 网上找的答案是在配置文件nginx.conf里面加上 user root owner;这个要加在配置文件的第一行才行,否则还是会报错,配置文件截图为: 参 ...

  8. tomcat部署jenkins启动报错:insufficient free space available after evicting expired cache entries-consider increasing the maximum size of the cache.

    在tomcat里面部署jenkins,启动tomcat,在jenkins上操作不久之后,jenkins就挂掉了,查看tomcat控制台,报内存溢出信息: 解决该问题方法,修改tomcat/bin目录下 ...

  9. 前端vue项目部署到tomcat,一刷新报错404解决方法

    公司前端写的后台部署到tomcat webapps目录下后,无法进行刷新,一刷新就会报错404,自动跳的404页面.在网上查了下,官方说是HTML5 History 模式引发的问题,但是解决方案中,并 ...

  10. 解决Tomcat下连接Oracle报错"Error while registering Oracle JDBC Diagnosability MBean."

    Tomcat不失为一个好的开发学习容器,但使用Oracle 11g自带的JDBC驱动ojdbc6.jar和JDK6一起运行的时候,特别是和spring框架一起使用会报错:SEVERE: Error w ...

随机推荐

  1. jQuery.Deferred(jQuery1.5-2.1)源码剖析

    jQuery.Deferred作为1.5的新特性出现在jQuery上,而jQuery.ajax函数也做了相应的调整.因此我们能如下的使用xhr请求调用,并实现事件处理函数晚绑定. var promis ...

  2. 关于HTML5手机端页面缩放的问题

    通常在写HTML5手机端页面的时候,我们会发现页面所显示元素的比例不正确,那此时我们需要添加的就是: <meta name="viewport" content=" ...

  3. Eclipse中一直出现 Android SDK resolving error markers

    Eclipse中一直出现“Android SDK: resolving error markers”. 此类情况网上有诸多描述以及相应尝试性的解决方法,不久前本人即出现此类情况,尝试多种方案后未能解决 ...

  4. 面向阿里云专家的 Azure 云服务介绍

    本文是面向阿里云专家的 Azure 云服务介绍,参考本文可以帮助大家“按图索骥”在 Azure 的平台上找到能满足自己需求的服务. 在公有云计算蓬勃发展的同时,中国也出现了越来越多的本土公有云平台.针 ...

  5. Bootstrap 入门到精通

    介绍 Bootstrap,来自 Twitter,是目前最受欢迎的前端框架.Bootstrap 是基于 HTML.CSS.JAVASCRIPT 的,它简洁灵活,使得 Web 开发更加快捷.Bootstr ...

  6. Mysql的Root密码忘记,查看或修改的解决方法

    Mysql的Root密码忘记,查看或修改的解决方法:1.首先启动命令行2.在命令行运行:taskkill /f /im mysqld-nt.exe3.继续在命令行运行:mysqld-nt --skip ...

  7. iOS打包上传app store各种问题解决总结

    问题1 this action could not be completed. try again 问题2 there was an error sending data to the iTunes ...

  8. HDOJ 4509 湫湫系列故事——减肥记II(2013腾讯编程马拉松) 并查集合并区间

    发现这种合并区间的题目还可以这么玩 给你n段时间 然后问没被占用的时间是多少 题目所给的区间是右开的导致我wa 好多人5e5*1440的暴力跑出来的时间居然只是我的两倍 不懂.... 所以并查集并没有 ...

  9. Asp.Net Core 入门(十)—— 模型绑定和验证

    模型绑定时将Http请求中的数据映射到控制器操作方法上对应的参数,操作方法中的参数可以是简单类型,如整形,字符串等,也可以是复杂类型,如Product,Order等. Asp.Net Core MVC ...

  10. NYOJ-06-喷水装置(一)

    http://acm.nyist.net/JudgeOnline/problem.php?pid=6 喷水装置(一) 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述 现有 ...