I installed Netbeans and tryed to access the server\'s manager using: (id/pass)manager/manager, admin/admin, system/password... None of them worked.
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:
conf/tomcat-users.xml
is located and which you want to open and read. C:\Users\Tushar Joshi\.netbeans\6.9\apache-tomcat-6.0.26_base
)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 alsohttp://localhost:8084/manager/
which shall be http://localhost:8084/manager/html
nowIf 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.
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 :
admin-gui
-> Username & Password - Do not Change.manager-gui
-> you can change user name & password for this only.
[Here password is not given]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.
try tomcat tomcat as the default username and password (tomcat 7)
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"/>