Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.63 KB

Tomcat.md

File metadata and controls

34 lines (21 loc) · 1.63 KB

Configuring Users and Roles in Apache Tomcat

Prerequisites

  • Apache Tomcat installed and configured on your server.

Steps to Configure Users and Roles

  1. Locate tomcat-users.xml file: This file is typically located in the conf directory of your Tomcat installation.

  2. Edit tomcat-users.xml: Open the tomcat-users.xml file in a text editor.

  3. Define Users: Within the <tomcat-users> element, define users using the <user> element. For example:

    <tomcat-users>
        <user username="admin" password="adminpassword" roles="manager-gui,admin-gui"/>
        <user username="deployer" password="deployerpassword" roles="manager-script"/>
        <!-- Additional users and roles can be defined here -->
    </tomcat-users>
  4. Define Roles: Roles define the permissions granted to users. Tomcat provides several built-in roles (manager-gui, manager-script, admin-gui, etc.). You can also define custom roles.

  5. Access Tomcat Management Interfaces: Depending on the roles assigned to users, they will have access to different Tomcat web applications:

    • manager-gui: Grants access to the Tomcat Manager web application.
    • manager-script: Grants access to the text-based interface for managing Tomcat using scripting.
    • admin-gui: Grants access to the Host Manager web application.
  6. Secure Configuration File: Ensure that the tomcat-users.xml file is properly secured, as it contains sensitive information such as user passwords.

  7. Restart Tomcat: After making changes to the tomcat-users.xml file, restart the Tomcat server for the changes to take effect.