Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What error are you getting when you try to log in? –  CoverosGene Oct 9 '09 at 21:20

4 Answers 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!

share|improve this answer
1  
Don't forget to restart tomcat after changing the file –  Gary Jan 11 '11 at 5:17
    
just had the same DOH! moment... –  Paul Aug 4 '11 at 12:22

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).

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.