java - 无法使用 Tomcat Manager 部署 war 文件

标签 java eclipse apache maven tomcat

我无法使用 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/

相关文章:

eclipse - 如何使用 Subclipse 设置文件创建的属性

c++ - Apache C++ 模块持久全局对象

mysql - 在 zend server 8.0 上设置 wordpress

java - Java Swing 中如何处理监听器?

java - 有大量参数的函数有什么解决方法吗?

java - 日期选择器外观损坏

java - 在eclipse插件中访问图像

带有英文和中文文本的java字符串

安卓 : Eclipse Juno

php - 如何防止 apache 在 URL 路径中用单斜杠减少双斜杠?