关于 tomcat7无法登录进ManagerApp管理界面 的问题

第一步,打开tomcat服务器,如果打不开tomcat服务器,请参考:

点击打开链接启动Tomcat失败,错误提示:the JRE_HOME environment variable is not defined correctly


第二步,打开浏览器,输入http://localhost:8080/ 登录tomcat主页

如果出现一只三脚猫图标,则说明登陆成功!

可能会出现端口号被占用的情况,打开tomcat7的安装路径下的conf - server.xml,修改前请先备份一份,防止出现错误。

将端口号的 8080 端口,修改成 任意未被占用的端口号 (例:8888),修改完后重新启动服务器

server.xml 中

<Connector port="8080" redirectPort="8443" connectionTimeout="20000" protocol="HTTP/1.1"/>

修改8080。


第三步,登录tomcat主页成功, 以manager角色登录,有一些已经存在的表后在之后的学习中用到,在网页右侧 有 Manager App 按钮,点击后跳出登录,

输入用户名:tomcat ,密码:tomcat 登录,如果不能登录,出现404 或 401界面,则说明 tomcat 角色 未被授权,再次打开tomcat7的安装路径下的conf - 

tomcat-users.xml, 打开前仍需 备份一份,防止错改。

<?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. It is strongly recommended that you do NOT use one of the users in the commented out section below since they are intended for use with the examples web application. -->




<!-- NOTE: The sample user and role entries below are intended for use with the examples web application. They are wrapped in a comment and thus are ignored when reading this file. If you wish to configure these users for use with the examples web application, do not forget to remove the <!.. ..> that surrounds them. You will also need to set the passwords to something appropriate. -->




<!-- <role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="<must-be-changed>" roles="tomcat"/> <user username="both" password="<must-be-changed>" roles="tomcat,role1"/> <user username="role1" password="<must-be-changed>" roles="role1"/> -->




</tomcat-users>

打开后,是这样的xml文件,把最后一部分的<!-- < role rolename = "tomcat" 到 roles = "role1"/>--> 的注释<!--  -->删掉,最好用EIDTPLUS 或 其它编辑器打开 ,看到这部分

内容高亮显示即可,修改其中的<must-be-changed>部分,修改密码,或者直接用下面代码覆盖:

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

注:千万不要删掉尾部的</tomcat-users>。


修改之后重新启动服务器,登录tomcat主页,再次尝试tomcat / tomcat 的方式登录,出现跳转页面即成功!





  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值