Setting up and running the Tomcat Manager
search cancel

Setting up and running the Tomcat Manager

book

Article ID: 12737

calendar_today

Updated On:

Products

Output Management Web Viewer

Issue/Introduction

After installing OM Web Viewer, you may need to run the Tomcat manager to confirm a successful Web Application Server (WAS) implementation. How do I set up and run the Tomcat Manager?

Environment

Output Management Web Viewer 12.1
Apache Tomcat®

Resolution

To use Tomcat's administration and management tools, you need to create a user with "admin" and "manager" roles. You can do this by editing the tomcat-users.xml file in the conf directory under the Tomcat directory using a text editor:
  1. Ensure Tomcat is running
  2. Delete the lines with comments around the last paragraph with the roles
  3. Add the following entries to create the "admin" and "manager" roles:
    • <role rolename="manager"/>
    • <role rolename="admin"/>
  4. Add the following entry to create the "admin" user:
    • <user username="admin" password="myAdminPwd" fullName="Administrator" roles="admin,manager"/>
  5. Save and close the file
  6. Restart Tomcat
  7. Log in to the Tomcat manager at http://localhost:8080/manager/html using the userid and password you added to the tomcat-users.xml)

  8. You should consider undoing this after we are done with the Tomcat manager as you might not need it regularly and leaving that section uncommented may get you tagged with a vulnerability.

Additional Information

As of a certain Build of Tomcat, the manager can only run on the LPAR where Tomcat was installed. To override this restriction, you must exit the file:

CA_OM_Web_Viewer\apache-tomcat-9.0.xxx\webapps\manager\META-INF\context.xml.

Modify the file by commenting the Valve xml tag

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<Context antiResourceLocking="false" privileged="true" >
  <CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"
                   sameSiteCookies="strict" />
  <!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />  -->
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>

You need to place the those comment markers in this file.
Restart Tomcat.