Apache Tomcat Configuration: Access Not Authorized

- 1 answer

I am using Apache Tomcat server. I installed successfully on my computer because the server in running but My problem is that I cannot open a page due wrong credential. Below is the message after I enter my credential as username: root and password: tomcat

Access to Tomcat server has not been authorized. Set the correct username 
and password with the "manager-script" role in the Tomcat customizer in the 
Server Manager.
See the server log for details.

What do I have do to do solve this issue or what is wrong?



In Windows operating system, Call %CATALINA_HOME% is directory what Apache Tomcat installed. (In Unix, macOS, $CATALINA_HOME is the home directory of Apache Tomcat)

Looking for file %CATALINE_HOME%\conf\tomcat-users.xml. Declare user and corresponding role follow instructor

<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"/>

This is an example, it just work

<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<user username="admin" password="admin" roles="manager-gui,manager-status,manager-script,manager-jmx"/>
<user username="admin2" password="admin2" roles="manager-gui,manager-status"/>
<user username="admin3" password="<must-be-changed>" roles="manager-jmx"/>

You need restart Apache Tomcat for new configuration in affected.