Thursday 8 February 2018

Default Administrator Password of Tomcat Apache Server

Tomcat 7 and Tomcat 8

Tomcat users are defined in the file – $TOMCAT_HOME/conf/tomcat-users.xml, by default, there is NO user, it means no one can access the Tomcat manager page.

To enable users to access the Tomcat manager page, add a user as the role manager-gui.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
$TOMCAT_HOME/conf/tomcat-users.xml (Original)
<tomcat-users>
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

$TOMCAT_HOME/conf/tomcat-users.xml (Updated)
<tomcat-users>
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->

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

</tomcat-users>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Saved it and restart Tomcat, now you should able to access the default manager page (http://ipaddress:8080/manager) with user = “admin” and password = “admin”