linux – 在Tomcat中拒绝访问403
发布时间:2020-12-14 02:32:32 所属栏目:Linux 来源:网络整理
导读:我在tomcat-users.xml中有以下内容: tomcat-usersrole rolename="admin"/role rolename="manager"/user username="aname" password="apassword" roles="admin,manager"//tomcat-users 如果我去http:// localhost:8080 / manager / html,我被问及用户名和
我在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),但是当我输入它们时,我得到了: 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... 这种行为可能是什么原因?提前致谢. 解决方法
要使用Web管理gui,您必须添加
gui role .
在[Tomcat安装路径] /conf/tomcat-users.xml中,您可以定义角色并将其影响到用户.例如 : <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> 注意 : 您可能没有在此定义的任何默认用户名和密码,因此花时间进行此配置总是好的,或者在使用NetBeans中集成的IDE时遇到问题.实际上,它需要这些凭证才能正确使用它. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
热点阅读