tomcat-users.xml

This file contains a list of user names, roles, and passwords, all of which is explained in Chapter 2 and the "UserDatabaseRealm" section. It is a simple XML file; the root element is tomcat-users and the only allowed child elements are role and user. Each role element has one attribute called rolename, and each user element has three attributes: name, password, and roles. The default tomcat-users.xml file contains the XML listed in Example 7-3.

Example 7-3. Tomcat 6.0 distribution version of tomcat-users.xml

<?xml version='1.0' encoding='utf-8'?>
<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>

Get Tomcat: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.