Tomcat中的403访问被拒绝 [英] 403 Access Denied in Tomcat

查看:2257
本文介绍了Tomcat中的403访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在tomcat-users.xml中具有以下内容:

<tomcat-users>
<role rolename="admin"/>
<role rolename="manager"/>
<user username="aname" password="apassword" roles="admin,manager"/>
</tomcat-users>

如果我转到http://localhost:8080/manager/html,系统会询问我用户名和密码(据我了解,关于tomcat-users.xml的用户名和密码),但是当我输入它们时,我会得到:

If I go to http://localhost:8080/manager/html, I'm asked about username and password (as far as I understand, about these from the tomcat-users.xml), but when I enter them, I get:

403 Access Denied
You are not authorized to view this page.

If you have already configured the Manager application to allow access and you have used your browsers back button...

这种行为可能是什么原因?预先感谢.

What could be a reason of such a behavior? Thanks in advance.

推荐答案

要使用Web管理gui,您必须添加

To use the web administration gui you have to add the gui role.

[Tomcat installation path]/conf/tomcat-users.xml中,您可以定义role并将其影响到user.例如:

In [Tomcat installation path]/conf/tomcat-users.xml you can define role and affect them to user. For example :

<tomcat-users>
    <role rolename="admin"/>
    <role rolename="admin-gui"/>
    <role rolename="manager"/>
    <role rolename="manager-gui"/>

    <user username="name" password="pwd" roles="admin,admin-gui,manager,manager-gui"/>
</tomcat-users>


注意:


Note :

您可能没有在此处定义任何默认用户名和密码,因此花一些时间进行此配置始终是一件好事,否则在使用集成在IDE中的Tomcat(例如NetBeans)时会遇到问题.确实,为了正确使用它,将需要这些凭据.

You may not have any default username and password defined here so it's always good to take the time to do this configuration or you'll encounter issue when using Tomcat integrated in IDE like NetBeans. Indeed it will require these credentials in order to use it properly.

这篇关于Tomcat中的403访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆