Tomcat 9 - 为 manager-gui 使用非明文密码无法正常工作

标签 tomcat

我尝试设置一个新的 Tomcat 9.0.11,启用了 manager-gui 并在 tomcat-user.xml 中使用散列密码进行管理员登录。我跟随 http://www.peter-eichenauer.de/safari/blog/entry/tomcat_9_understanding_credentialhandler

我可以登录到 manager-gui,但不是使用真实密码,而是仅使用散列密码字符串。所以 Tomcat 很可能使用散列密码作为真实密码,但我设置了

<CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="sha-256">

在 server.xml 中。所以我不知道该怎么办。请帮忙!

提前致谢

最佳答案

好的,我找到了解决方案。我在 server.xml 中犯了一个错误: 而不是:

     <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase" >
            <CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="sha-256" />
  </Realm></Realm>

我写道:

      <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase" />
            <CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="sha-256" />
  </Realm>

一个愚蠢的关闭 Realm 错误。感谢大家!!!!

关于Tomcat 9 - 为 manager-gui 使用非明文密码无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53538135/

相关文章:

java - Tomcat:在不冒 OutOfMemoryError 风险的情况下增加 maxThreads

java - org.apache.catalina.LifecycleException : Failed to start component [StandardEngine[Catalina]. 标准主机

JSP 信息页面创建

apache - 使用 Apache 启用 url 重写

java - jsp "unable to compile"和 "cannot be resolved to a type"

java - 带有 Tomcat 9.0 的 DSpace 7.2 - 属性定义中的圆形占位符引用 'dspace.dir'

apache mod proxy 和 tomcat comet

java - 如何通过已知的PID/TID获取JVM线程名/id

tomcat - 具有连接池的 MySQL DataSource,在运行时设置 URL

java - 如何部署 Web 应用程序