0

Folks,

I can't login to the manager app (localhost:8080/manager/html) in my Tomcat. More specifically, it asks for my username and password, and the ones supposed to be correct aren't accepted. Here's what I already checked:

  • I tried editing my conf/tomcat-users.xml to add my user/role. Here's the current content of this file:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
    <role rolename="manager"/>
    <user username="tomcat" password="s3cret" roles="manager"/>
</tomcat-users>
  • I thought that maybe it wasn't looking up on this XML, but elsewhere. So, I came to know about Realms. The Realm part of my configuration is now:

< Realm className="org.apache.catalina.realm.MemoryRealm" />

( please ignore the space before Realm, for some reason this site isn't accepting the literal tag )

What am I missing?

1
  • What error are you getting when you try to log in? Oct 9, 2009 at 21:20

4 Answers 4

4

I went around in circles on this for a while then had a DOH! moment when I realized the defaut tomcat-users.xml file has the sample list of users commented out with XML comments!

2
  • 1
    Don't forget to restart tomcat after changing the file
    – Gary
    Jan 11, 2011 at 5:17
  • just had the same DOH! moment...
    – Paul
    Aug 4, 2011 at 12:22
2

I've seen hundreds of cases of this, and almost always, it's what the answer about the comment line says. For total newbies, that's the "< ! - - " line at the beginning and the "- - >" line at the bottom. I had to add spaces to that because this damned editor tries to comment out everything between them. Very handy. Then execute: sudo /etc/init.d/tomcat6 restart so that it picks up the changes and, VOILA!, it works. Since tomcat/tomcat is already in there, all you have to do is remove those two comment lines, restart, and tomcat/tomcat works (assuming it's there in your file with manager role).

0

Try turning off tomcat security manager, restarting tomcat and see if that allows you to login. I had to do something along those lines when I set up tomcat.

0

This may be waaaay to late to help you at all, but I was having this same problem when I stumbled on your question. Although the documentation says that you can simply use the default location for the tomcat-users.xml file, I found that it actually doesn't seem to want to work.

Try specifying the file location like so:

<Realm className="org.apache.catalina.realm.MemoryRealm" pathname="conf/tomcat-users.xml"/>

and see if you have any luck with that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .