JSP Tutorials - Herong's Tutorial Examples - Version 4.03, by Dr. Herong Yang
Setting Up Tomcat 7 Server Admin Access
This section provides a tutorial example on how to set up admin access (user role, name and password) to Apache Tomcat 7 server. 2 entries are needed in the conf\tomcat-users.xml file: 'role' and 'user'.
Having Tomcat 7 installed and started correctly, the next thing to do is to set up the admin username and password, so that you can manage the server from the Web GUI. This can be done by adding user roles, names and passwords in the server configuration file, tomcat-users.xml.
1. Edit \local\apache-tomcat-7.0.32\conf\tomcat-users.xml with Notepad.
2. Add 2 lines near the end of the file to set up a user role and a user login:
<?xml version='1.0' encoding='utf-8'?> <!-- ... license info ... --> <tomcat-users> <!-- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. --> <!-- NOTE: The sample user and role entries below are wrapped in a comment and thus are ignored when reading this file. Do not forget to remove <!.. ..> that surrounds them. --> <!-- <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"/> --> <role rolename="manager-gui"/> <user username="herong" password="s3cret" roles="manager-gui"/> </tomcat-users>
By default, Tomcat 7 supports the following user roles that you can use to set up multiple logins for different level of accesses:
Last update: 2012.
Table of Contents