I'm trying to access the manager app, but I can't login. I get the logon screen, but when I enter the username and password, the login screen keeps coming back. Any suggestions?
This is what I'开发者_StackOverflow中文版ve done: The manager app is deployed in $CATALINA_BASE/webapps/manager
Part of the server.xml file:
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="$CATALINA_BASE/conf/tomcat-users.xml" />
...
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
tomcat-users.xml:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="tomcat-user" password="tomcat" roles="manager-gui,manager-script"/>
<user username="tocmat2" password="tomcat" roles="manager-script"/>
</tomcat-users>
In $CATALINA_BASE/conf/Catalina/localhost/manager.xml:
<Context privileged="true"
docBase="path/to/webapps/manager">
</Context>
Change
pathname="$CATALINA_BASE/conf/tomcat-users.xml" />
to
pathname="conf/tomcat-users.xml" />
精彩评论