How do I set Tomcat Manager Application User Name and Password for NetBeans?

后端 未结 11 1889
旧时难觅i
旧时难觅i 2020-12-04 09:46

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

相关标签:
11条回答
  • 2020-12-04 10:07

    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"/>
    
    0 讨论(0)
  • 2020-12-04 10:10

    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

    Most Important:

    Don't forget to remove the comment lines from the tomcat-users.xml just before the start of the roles. <!-- -->

    0 讨论(0)
  • 2020-12-04 10:11

    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

    0 讨论(0)
  • 2020-12-04 10:22

    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

    0 讨论(0)
  • 2020-12-04 10:23

    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.

    enter image description here

    0 讨论(0)
  • 2020-12-04 10:24

    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.

    0 讨论(0)
提交回复
热议问题