united-coders

TwitterFacebookGoogleRSS
  • Home
  • Authors
    • Christian Harms
    • Nico Heid
  • Newsletter
Home » How to access the manager servlet of Apache Tomcat

How to access the manager servlet of Apache Tomcat

Posted on April 18, 2009 by Phillip Steffensen Posted in Uncategorized

If you set up a brand new tomcat with the default configuration, you are unable to access the manager servlet. All requests on http://[YourHost]:[TomcatPort]/manager/html are responded by a HTTP Status 403 (“Access to the requested resource has been denied”). If you use your tomcat for a productive system the manager servlet should always be deactivated. The tomcat’s default configuration hides the manager servlet for some security reasons. If you want to access the manager servlet you should add some lines to your tomcat-users.xml at $CATALINA_HOME/conf/tomcat-users.xml and restart your tomcat.

The default content of tomcat-users.xml is:

<?xml version='1.0' encoding='utf-8'>
<tomcat-users>
    <role rolename="tomcat" />
    <role rolename="role1" />
    <role rolename="admin" />
    <user username="tomcat" password="tomcat" roles="tomcat" />
    <user username="role1" password="tomcat" roles="role1" />
    <user username="both" password="tomcat" roles="tomcat,role1" />
</tomcat-users>

To make the manager servlet reachable you should modify your tomcat-users.xml like that:

<?xml version='1.0' encoding='utf-8'>
<tomcat-users>
    <role rolename="tomcat" />
    <role rolename="role1" />
    <role rolename="manager" />
    <role rolename="admin" />
    <user username="tomcat" password="tomcat" roles="tomcat" />
    <user username="role1" password="tomcat" roles="role1" />
    <user username="both" password="tomcat" roles="tomcat,role1" />
    <user username="YOUR_USERNAME" password="YOUR_PASSWORD" roles="manager,admin" />
</tomcat-users>

After restarting tomcat you are now able to access http://[YourHost]:[TomcatPort]/manager/html by entering YOUR_USERNAME and YOUR_PASSWORD on the htaccess-prompt. Some might think that it is safe enough to add a strong password to the manager/admin-account. But is it really safe enough to hide the manager servlet behind a simple htaccess login? No! You may not want that somebody accesses your tomcat servers manager servlet and drops all your applications, if he/she knows the login. Maybe somebody does it in the malicious way or maybe it is only a mistake. To protect the tomcat and applications from such faults, you should not modify the default tomcat-users.xml for productive systems.

  • Bio
  • Latest Posts

Phillip Steffensen

Latest posts by Phillip Steffensen (see all)

  • Android: Dealing with ListActivities, customized ListAdapters and custom-designed items - July 14, 2010
  • Developing a simple SOAP-webservice using Spring 3.0.1 and Apache CXF 2.2.6 - February 27, 2010
  • Spring Module OXM – A new feature of Spring Framework 3.0 - December 29, 2009
« Functional programming with Python
Maven 2 (Part 1): Setting up a simple Apache Maven 2 project »

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tags

android code jam code puzzle hackercup hosting java javascript linux permutations project euler python server

Recent Comments

  • http://underarmwhitening.Info on Number crunching with javascript – a tutorial
  • Nico Heid on A scalable, affordable WordPress hosting, lessons learned
  • Per Quested Aronsson on A scalable, affordable WordPress hosting, lessons learned
  • Christian Harms on A scalable, affordable WordPress hosting, lessons learned
  • Yoda Conditions | Pack 6 – Palo Alto on What are yoda conditions?

Recent Posts

  • All you need to know about Raspberry Pi colocation offers
  • A scalable, affordable WordPress hosting, lessons learned
  • google code jam 2013 – tic-tac-toe-Tomek solution
  • Google code jam 2013 – the lawnmower
  • code puzzles and permutations

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Copyright

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
© united-coders
  • If you set up a brand new tomcat with the default configuration, you are unable to access the manager servlet. All requests on http://[YourHost]:[TomcatPort]/manager/html are responded by a HTTP Status 403 ("Access to the requested resource has been denied"). If you use your tomcat for a productive system the manager servlet should always be deacti