I\'m trying to follow a tutorial to make an extremely basic Java web application in NetBeans.
When I try to run it, a dialogue box appears title \"Authentication Req
Update the 'apache-tomcat-8.5.5\conf\tomcat-users.xml file. uncomment the roles and add/replace the following line.and restart server
tomcat-users.xml file
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="standard,manager,admin,manager-gui,manager-script"/>
Use something like this to update your tomcat users.
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
Tomcat users file is located inside conf
folder of tomcat installation.
To find the path of catalina_base you can use the command:
ps aux | grep catalina
You can find one of the values -Dcatalina.base=/usr/local/Cellar/tomcat/9.0.37/libexec
Don't forget to remove the comment lines from the tomcat-users.xml just before the start of the roles. <!-- -->
Well if you are using Netbeans in Linux, then you should look for the tomcat-user.xml in
/home/Username/.netbeans/8.0/apache-tomcat-8.0.3.0_base/conf
(its called Catalina Base and is often hidden) instead of the Apache installation directory.
open tomcat-user.xml inside that folder, uncomment the user and roles and add/replace the following line.
<user username="tomcat" password="tomcat" roles="tomcat,admin,admin-gui,manager,manager-gui"/>
restart the server . That's all
One simple way to check your changes to that file in Tomcat 8 + is to open a browser to: http://localhost:8080/manager/text/list
I case of tomcat 7 the role has changed from manager to manager-gui so set it as below in the tomcat-user.xml file.
You will find the tomcat-users.xml in \Users\<Name>\AppData\Roaming\Netbeans\
. It exists at least twice on your machine, depending on the number of Tomcat installations you have.