我已经在stackoverflow中阅读了很多主题来解决我的问题,但没有一个是有用的.
当我尝试使用许多不同的配置登录Manager App([http:// localhost:8080/manager/html] [1])时,但在尝试使用权限凭据登录后,我总是获得401 Unauthorized.我重启了tomcat服务器几次.
这是我在conf/tomcat-users.xml中的最后一次配置
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui, manager-script, manager-jmx, manager-status, admin-gui, admin-script"/>
</tomcat-users>
Run Code Online (Sandbox Code Playgroud)
这是与server.xml中的tomcat-users相关的部分
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<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="conf/tomcat-users.xml" />
</GlobalNamingResources>
Run Code Online (Sandbox Code Playgroud)
这是我的配置:Apache Tomcat:版本7.0.40 64位在Chrome 26上测试
如果我忘记了其他有用的东西,请告诉我.提前致谢