What is the default username and password in Tomcat?

前端 未结 18 915
无人共我
无人共我 2020-12-04 09:18

I installed Netbeans and tryed to access the server\'s manager using: (id/pass)manager/manager, admin/admin, system/password... None of them worked.

相关标签:
18条回答
  • 2020-12-04 10:01

    My answer is tested on Windows 7 with installation of NetBeans IDE 6.9.1 which has bundled Tomcat version 6.0.26. The instruction may work with other tomcat versions according to my opinion.

    If you are starting the Apache Tomcat server from the Servers panel in NetBeans IDE then you shall know that the Catalina base and config files used by NetBeans IDE to start the Tomcat server are kept at a different location.

    Steps to know the catalina base directory for your installation:

    1. Right click on the Apache Tomcat node in Servers panel and choose properties option in the context menu. This will open a dialog box named Servers.
    2. Check the directory name of the field Catalina Base, this is that directory where the current conf/tomcat-users.xml is located and which you want to open and read.
      (In my case it is C:\Users\Tushar Joshi\.netbeans\6.9\apache-tomcat-6.0.26_base )
    3. Open this directory in My Computer and go to the conf directory where you will find the actual tomcat-users.xml file used by NetBeans IDE. NetBeans IDE comes configured with one default password with username="ide" and some random password, you may change this username and password if you want or use it for your login also
    4. This dialog box also have username and password field which are populated with these default username and password and NetBeans IDE also offers you to open the manager application by right clicking on the manager node under the Apache Tomcat node in Servers panel
    5. The only problem with the NetBeans IDE is it tries to open the URL http://localhost:8084/manager/ which shall be http://localhost:8084/manager/html now
    0 讨论(0)
  • 2020-12-04 10:01

    If your apache tomcat asking for password,then just follow these steps: go to the home directory of apache then go to webapps folder open the META-INF inside that you will find an xml file named context.xml--open it in edit mode

    and REMOVE THE COMMENT FROM the VALVE tag.

    After that you dont need any user name and password.

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

    Open tomcat-users.xml which should be in C:\Tomcat 7.0\conf

    Add following lines in above file :

    <tomcat-users>
         <role rolename="manager-gui"/>
         <user username="admin" password="" roles="manager-gui"/>
    
         <role rolename="admin-gui"/>
         <user username="tomcat" password="s3cret" roles="admin-gui"/>        
     </tomcat-users>
    

    Note :

    1. admin-gui -> Username & Password - Do not Change.
    2. manager-gui -> you can change user name & password for this only. [Here password is not given]
    0 讨论(0)
  • 2020-12-04 10:04

    First navigate to below location and open it in a text editor

    <TOMCAT_HOME>/conf/tomcat-users.xml
    

    For tomcat 7, Add the following xml code somewhere between <tomcat-users>

      <role rolename="manager-gui"/>
      <user username="username" password="password" roles="manager-gui"/>
    

    Now restart the tomcat server.

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

    try tomcat tomcat as the default username and password (tomcat 7)

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

    In Tomcat 7 you have to add this to tomcat-users.xml (On windows 7 it is located by default installation here: c:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\ )

    <?xml version="1.0" encoding="UTF-8"?>
    <tomcat-users>
      <role rolename="manager-gui"/>
      <role rolename="manager-script"/>
      <role rolename="manager-jmx"/>
      <role rolename="manager-status"/>
      <role rolename="admin-gui"/>
      <role rolename="admin-script"/>
      <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
    </tomcat-users>
    

    NOTE that there shouldn't be ANY spaces between roles for admin, as this list should be comma separated.

    So, instead of this (as suggested in some answers:

    <user username="admin" password="admin" roles="manager-gui, manager-script, manager-jmx, manager-status, admin-gui, admin-script"/>
    

    it MUST be like this:

      <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
    
    0 讨论(0)
提交回复
热议问题