Monday, October 14, 2013

Tomcat Users

Dear reader, Writing a very basic code for Roles and Permissions for Tomcat users. When you download Apache Tomcat and run the App, you are being asked a User Name and password to see Apps currently deployed in Tomcat. You need to edit "tomcat-users.xml" in "TOMCAT_INSTALLED_DIRECTORY/conf" directly. Replace the existing file with below code and restart tomcat.
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="admin"/>
  <role rolename="manager"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="admin" password="admin" roles="admin,manager"/>  
  <role rolename="manager-gui"/>
  <user username="admin" password="manager" roles="manager-gui"/>
</tomcat-users>

No comments:

Post a Comment