我无法使用 Tomcat Manager 部署 war 文件
我的\Tomcat\conf\tomcat-users.xml 如下所示:
<!--
<role rolename="manager-gui"/>
<user name="tomcat" password="admin" roles="admin-gui,standard,manager-gui"/>
-->
此外,将 localhost-config\tomcat-users.xml 处的\Servers\Tomcat v7.0 Server 编辑为
<!--
<role rolename="manager-gui"/>
<user name="tomcat" password="admin" roles="admin-gui,standard,manager-gui"/>
-->
启动服务器时仍然显示以下错误:http://localhost:8080/manager/html并提供适当的凭据
401 Unauthorized
You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.
For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.
我也尝试将 manager.xml 添加到\Tomcat\conf 但没有任何效果
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.0\.0\.1" />
</Context>
注意:我正在重新启动服务器并 http://localhost:8080/不工作
最佳答案
<role>
和<user>
标签只是 XML 注释中的纯文本,周围是 <!--
和-->
。删除评论的开头和结尾。
<!-- <<< BEGINNING OF COMMENT. Remove this line
<role rolename="manager-gui"/>
<user name="tomcat" password="admin" roles="admin-gui,standard,manager-gui"/>
--> <<< END OF COMMENT. Remove this line
关于java - 无法使用 Tomcat Manager 部署 war 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35321562/