问题描述
我在这里阅读了许多类似的问题,但无论我做什么,我都无法登录管理器应用程序.我做了什么.
1.我通过添加
I read many similar problems here, but whatever I do, I can't login to manager app. What I have done.
1. I edited the tomcat-users.xml
by adding
<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"/>
- 我使用 Netbeans 启动了 Tomcat (V.8)
- 我访问了 localhost:8084(netbeans 将端口设置为 8084)并单击了管理器应用程序".
- 在提示窗口中,我输入了 admin 和 admin 却没有登录.
在 Netbeans 中服务器的属性中,有不同的凭据.我对它们都进行了相同的设置(到 tomcat-users.xml 和 Netbeans 中的那里),但仍然没有任何反应.
每次我进行更改时,我总是重新启动 Tomcat(没有发生错误.
编辑
当我尝试运行我的应用程序(默认应用程序,当你在Netbeans中创建一个项目时),我也不能登录,因此出现此消息 Deployment error: Access to Tomcat server has not beenauthorized.在服务器管理器的 Tomcat 定制器中使用manager-script"角色设置正确的用户名和密码.详情请参阅服务器日志.
不过我已经在 tomcat-users.xml 中添加了上述内容...
In the properties of the server in Netbeans, there are different credentials. I put the same to both of them (to tomcat-users.xml and there in Netbeans) and still nothing happens.
Every time I make a change, I always restart the Tomcat (no error occurs).
EDIT
When I try to run my application (the default one, when you create a project in Netbeans), I also can't login, so this messages comes up Deployment error: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager-script" role in the Tomcat customizer in the Server Manager.See the server log for details.
However I have added the above in the tomcat-users.xml ...
推荐答案
确保您正在编辑正确的文件.NetBeans 将创建它自己的配置文件副本,因此您可能有两个或多个 tomcat-users.xml 文件.在我的 Windows 机器上,NB 启动的 Tomcat 使用C:\Users\DevServer\AppData\Roaming\NetBeans\8.0\apache-tomcat-8.0.3.0_base\conf
Make sure you're editing the correct file. NetBeans will create it's own copy of the configuration files, so you may have two or more tomcat-users.xml files. In my case on my windows machine, the Tomcat launched by NB usesC:\Users\DevServer\AppData\Roaming\NetBeans\8.0\apache-tomcat-8.0.3.0_base\conf
此外,尝试简化并创建一个仅具有 manager-script 角色的用户.然后在服务/服务器/连接凭据中告诉 NB 该用户和密码.示例:
Also, try simplifying and create a user with just the manager-script role. Then tell NB about that user and pw in the Services/Servers/Connection credentials. Example:
<user username="tomcat_m_script" password="pwhere" roles="manager-script"/>
<user username="tomcat_m_script" password="pwhere" roles="manager-script"/>
这篇关于无法访问 Tomcat 8 中的 Manager-app的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!