Setting Up Tomcat Server Admin Access

This section provides a tutorial example on how to set up admin access (user role, name and password) to Apache Tomcat server. 2 entries are needed in the conf\tomcat-users.xml file: 'role' and 'user'.

Having Tomcat 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\tomcat\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 ...
  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"/>


By default, Tomcat supports the following user roles that you can use to set up multiple logins for different level of accesses:

Table of Contents

 About This Book

 JSP (JavaServer Pages) Overview

Tomcat Installation on Windows Systems

 Downloading and Installing Tomcat

 Launching Tomcat Server

 Verifying Tomcat Server

Setting Up Tomcat Server Admin Access

 Reviewing Tomcat Server Status Page

 Tomcat Web Application Manager

 My First HTML Page - hello.html

 My First JSP Page - hello.jsp

 JSP Scripting Elements

 Java Servlet Introduction

 JSP Implicit Objects

 Syntax of JSP Pages and JSP Documents

 JSP Application Session

 Managing Cookies in JSP Pages

 JavaBean Objects and "useBean" Action Elements

 Managing HTTP Response Header Lines

 Non-ASCII Characters Support in JSP Pages

 Performance of JSP Pages

 EL (Expression Language)

 Overview of JSTL (JSP Standard Tag Libraries)

 JSTL Core Library

 JSP Custom Tags

 JSP Java Tag Interface

 Custom Tag Attributes

 Multiple Tags Working Together

 File Upload Test Application

 Using Tomcat on CentOS Systems

 Using Tomcat on macOS Systems

 Connecting to SQL Server from Servlet

 Developing Web Applications with Servlet

 Archived Tutorials


 Full Version in PDF/EPUB