setup Tomcat admin and manager password

Apache Tomcat is a servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a “pure Java” HTTP web server environment for Java code to run.

Tomcat should not be confused with the Apache web server, which is a C implementation of an HTTP web server; these two web servers are not bundled together. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files.

Question :

How to enable  Tomcat  admin password  ?

answer :

Tomcat5.5 and 6.x  do not enable admin or manager access by default. We have to manully edit tomcat-users.xml to allow admin access. VI your tomcat-users.xml in   /etc/tomcat6  folder, content is something like following

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 only create a tomcat user for normal access, we have to modify a bit like following

role rolename=”manager”/>
role rolename=”admin”/>
user username=”admin” password=”admin” roles=”admin,manager”/>




Saved it and restart tomcat, now we can access tomcat admin or maneger page with user:admin password:admin.

dont  foirget  to add  (<) before every line

its  works   fine