403 Access Denied in Tomcat

In tomcat-users.xml , I have the following:

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

If I go to http://localhost:8080/manager/html , they will ask me about the username and password (as I understand it from 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 causing this behavior? Thanks in advance.

+6
source share
1 answer

To use gui web administration, you must add a gui role .

In [Tomcat installation path]/conf/tomcat-users.xml you can define a role and influence them on user . For instance:

 <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:

You may not have the default username and password defined here, so it is always useful to take the time to complete this configuration or you will encounter a problem when using Tomcat integrated into the IDE, such as NetBeans. In fact, these credentials will be required to use them correctly.

+21
source

Source: https://habr.com/ru/post/918344/


All Articles