This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Need help viewing the Tomcat Manager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Need help viewing the Tomcat Manager" Watch "Need help viewing the Tomcat Manager" New topic

Need help viewing the Tomcat Manager

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 276
Hi All,
I would like to look at the Tomcat Manager, but when I try, I am prompted to enter a name and password. Ia m not sure what to use for these values. I did a search here and found the following info:
A lot of this information can be seen from the Tomcat Manager/html application .

On a default install:

You may need to add your name to the realm in the tomcat/conf/tomcat-users.xml file. Once on the page, click the Server Status link on the right side of the header.

My question is, what does it mean to "add your name" to the realm in the tomcat-users.xml file? I tried to enter one of the name/passwords that I saw in this file, but the name/password prompt just cleared and didnt let me enter the manager.
Thanks for any info! Kim
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 276
Hey, I have found more info on :

I am still struggling though on this step:

JDBCRealm - Your user and role information is stored in a database accessed via JDBC. Add the manager role to one or more existing users, and/or create one or more new users with this role assigned, following the standard procedures for your environment.

I am using a JDBCRealm. I had assumed I should add a userName and password to tomcat-users.xml, but since I am using a JDBCRealm, does the above quote indicate that I need to edit a database table? I have looked at my database users and dont see anywhere to add roles. I just see how to manage permissions. Help!
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
The tomcat-users.xml file is only used for MemoryRealm, not for any of the others. Have a look at the JDBCRealm documentation. It has a simple example of how to access your user/role tables, but your tables can be more complicated if need be. Just make sure to enter the table and attribute names correctly in the respective attributes in the server.xml file.
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 276
Hi ,
Sorry, I made a mistake. I am not using a JDBC Realm. It was defined in my Server.xml file, but I just learned that it is a bit of legacy code, its not used anymore, so I guess I do need to user Tomcat-Users.xml. I wonder why it will not work. Here is what I have put in to tomcat-users:

Shouldn't I be able to start the manager using name=kim password=kim ?
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 276
Success ! Turns out that my REALM was not defined correctly in my server.xml file. As soon as I fixed that, I was able to log into the manager.

I had the realm defined as a JDBCRealm, but it refered to database tables which didnt even exist, when i switched over to MemoryREALM, everything works fine.

Thanks for the input!
I agree. Here's the link:
subject: Need help viewing the Tomcat Manager
It's not a secret anymore!