我正在使用 Apache Tomcat 服务器。我在我的计算机上安装成功,因为服务器正在运行,但我的问题是由于错误的凭据我无法打开页面。以下是我输入我的凭据作为用户名后的消息:root
和密码:tomcat
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.
我该怎么做才能解决这个问题或出了什么问题?
最佳答案
在Windows操作系统中,Call %CATALINA_HOME%
是Apache Tomcat安装的目录。 (在Unix、macOS中,$CATALINA_HOME
是Apache Tomcat的家目录)
正在寻找文件 %CATALINE_HOME%\conf\tomcat-users.xml
。声明用户和对应的角色follow instructor
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
这是一个例子,它可以正常工作
<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<user username="admin" password="admin" roles="manager-gui,manager-status,manager-script,manager-jmx"/>
<user username="admin2" password="admin2" roles="manager-gui,manager-status"/>
<user username="admin3" password="<must-be-changed>" roles="manager-jmx"/>
受影响的新配置需要重启 Apache Tomcat。
引用:https://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Configuring_Manager_Application_Access
关于java - Apache Tomcat 配置 : Access not authorized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48597559/