Tomcat Administration Tool XML

The Tomcat Administration tool, also known as admintool, configures the behavior of the Tomcat JSP container. You can save the changes persistently that you made to the Tomcat container by using the admintool. This ensures that the changes are in effect when the Tomcat server restarts. Otherwise, the changes remain effective during the current session only.

Running the Admintool

To run the admintool, you need to start Tomcat by executing the following command at the command prompt:

C:> startup
After you start Tomcat, type the following address in the address bar of your Web browser:

http://localhost:8080admin
The login interface to the admintool is displayed in Figure.

The Login Interface of Tomcat

The Login Interface of Tomcat

As you can see, you need to provide your username and password. A user can be assigned the role of admin, manager, and provider. By default, the user is assigned to all three roles. The username and password are specified in the tomcat-users.xml file. The tomcatusers. xml can be found at the <JWSDP_HOME>/conf directory. A sample tomcat-users.xml is shown here:

After successful logon, the interface, as shown in Figure, is displayed.

The Main Interface of Tomcat

The Main Interface of Tomcat

Notice that in Figure, the admintool provides you with access to various elements that can be configured. These elements are listed in the left pane of the interface. These elements are one of three main categories:

  • Tomcat server elements
  • Resource elements
  • Elements for user definitions

The interface to configure Tomcat server properties is displayed in Figure.

The Server Properties Page of Tomcat

The Server Properties Page of Tomcat

In the interface, as shown in Figure, you can perform and save the changes. You have the option of saving the changes either for the current session or persistently. To save the 320 changes for the current session, you need to click the Save button. To save the changes persistently, you need to click the Commit Changes button. When you click the Commit Changes button, the changes are saved to the <JWSDP_HOME>/conf/server.xml file.

The elements in the Resources group represent global JNDI resources. You can configure the following resources by using the admintool:

  • Data sources
  • Environment entries
  • User databases

The interface to configure environment entries is displayed in Figure.

The Environment Properties Page

The Environment Properties Page

Authenticating Users to Access Web Services

When you're designing Web services, you need to decide the types of users who will access them. Not all users should be given the right to access all services. The Tomcat user authentication service includes the following:

  • Role. Role is used to identify the set of resources you are allowed to access.
  • User. User is authenticated individually.
  • Group. Group is a set of users.
  • Realm. Realm is a set of roles, users, and groups that identifies the valid users of a Web service.

The User page of the Tomcat server is displayed in Figure.

The User Page of the Tomcat Server

The User Page of the Tomcat Server

You can use this interface to create new users or delete existing ones. You can do this by selecting the appropriate option from the Edit Existing User Properties list box, shown in Figure.

The Edit Existing User Properties List Box

The Edit Existing User Properties List Box

If you select the Create New User option from the drop-down list, the User Properties interface is displayed in the right pane of the admintool interface, as shown in Figure.

The Interface for Creating New Users

The Interface for Creating New Users

You can specify user details in the screen displayed in Figure. When you save the changes, the tomcat-users.xml file is modified, as shown in the following code:

After saving the changes, you can log out of the admintool by clicking on the Log Out button.



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XML Topics