This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Cannot log into management pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Cannot log into management pages" Watch "Cannot log into management pages" New topic

Cannot log into management pages

Scott Jackson

Joined: Oct 08, 2012
Posts: 5
I'm sure this comes up too often, and I've found other threads but the solutions given have not helped me.

I've installed Tomcat 7 on OSX Mountain Lion according to the instructions at:

I'm using the following tomcat-users.xml:The login prompt is repeated over-and-over, until canceled and a 401 Unauthorized is returned.

Thank you for your assistance,
-Scott Jackson
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959

Welcome to the JavaRanch, Scott!

Usually people worry about the tomcat-users.xml file (which appears to be OK for you), but neglect to switch on the Realm that uses it.

Tomcat (like most J2EE servers) supports a "plug-in" security system. The tomcat-users.xml file is used by the MemoryRealm and UserDataBaseRealm plugins, so you have to activate one of them. In the Tomcat6 supplied server.xml, that Realm is already coded in, but it's commented out.

Customer surveys are for companies who didn't pay proper attention to begin with.
Scott Jackson

Joined: Oct 08, 2012
Posts: 5
Hi Tim. It's been a warm welcome from all.

I looked at the server.xml, and it appears the UserDatabaseRealm was already enabled.My XML editor says that block is not commented out, so this doesn't appear to be the problem?

Thank you!
Scott Jackson

Joined: Oct 08, 2012
Posts: 5
Not sure if it is related, but the security listener IS commented out:
Scott Jackson

Joined: Oct 08, 2012
Posts: 5
OK I have it working, but I'm not sure what I did that did it.

First, I attempted to see if it was a permissions issue. Since my instructions configured tomcat to run under a specific account, I gave that account (and group) blanket ownership of the files in the install directory (and below).This did not solve the problem. A coworker suggested replacing my tomcat-users.xml with the one in the distribution archive, which I did. I then added the manager-gui role to the tomcat user as follows:And at this point I can login as the user "tomcat". With it operational now, I'm a little timid about tearing it all back down and trying to reproduce my success. Hopefully this will help someone in the future, though.
I agree. Here's the link:
subject: Cannot log into management pages
Similar Threads
Login to Tomcat 6 Manager Fails on Locahost - Using OS X
Tomcat 6.0.30: cannot deploy application: access denied.
Help required with tomcat-users.xml file
Unable to access Tomcat Manager Application(http://localhost:8080/manager
Unable to login to manager GUI