Skip to content

Instantly share code, notes, and snippets.

@sajidrahman
Last active October 17, 2018 15:06
Show Gist options
  • Save sajidrahman/72a69b9757dcc2103eebe49d44e7015a to your computer and use it in GitHub Desktop.
Save sajidrahman/72a69b9757dcc2103eebe49d44e7015a to your computer and use it in GitHub Desktop.
How to access Tomcat Manager Web Interface

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.

Step 0. Shutdown Tomcat if it is running. Stop Java process as well, just to be safe.

Step 1. Open tomcat-users.xml file, originally it should contain a commented out part for tomcat-users.

<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>

Step 2. Replace everything between <tomcat-users> and </tomcat-users> with the following:

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

Now your file should look like this:

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

Step 3. Save the file and restart Tomcat, now you should able to access the default manager page (http://localhost:8080/manager) with user = “admin” and password = “admin”

If everything goes well, you should see the shiny Tomcat manager interface and deploy web applications (war file) pretty easily.

@sajidrahman
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment