简体   繁体   English

无法使用Tomcat Manager部署War文件

[英]Unable to deploy war file using Tomcat Manager

I am unable to deploy war file using Tomcat Manager 我无法使用Tomcat Manager部署War文件
My \\Tomcat\\conf\\tomcat-users.xml looks like below: 我的\\ Tomcat \\ conf \\ tomcat-users.xml如下所示:

<!--
<role rolename="manager-gui"/>    
<user name="tomcat" password="admin" roles="admin-gui,standard,manager-gui"/>
-->

Also, edited \\Servers\\Tomcat v7.0 Server at localhost-config\\tomcat-users.xml to 另外,在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"/>
-->

Still it is showing below error on launching server as http://localhost:8080/manager/html and providing appropriate credentials 仍然在启动服务器时显示以下错误,显示为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.

I have also tried adding manager.xml to \\Tomcat\\conf but nothing worked 我也尝试将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>

Note: I am restarting the server and http://localhost:8080/ is not working 注意:我正在重新启动服务器,并且http:// localhost:8080 /无法正常工作

You need un-comment user entry in tomcat-users.xml . 您需要在tomcat-users.xml取消注释用户条目。

You need add users to /tomcat-users.xml otherwise you can't deploy war file through manager app. 您需要将用户添加到/tomcat-users.xml否则无法通过管理器应用程序部署war文件。

Example: 例:

<user username="craigmcc" password="secret" roles="standard,manager-script" />

More configuration details are here . 更多配置细节在这里

The <role> and <user> tags are just plain text in an XML comment, surrounded by <!-- and --> . <role><user>标记只是XML注释中的纯文本,由<!---->包围。 Remove the beginning and end of comment. 删除评论的开头和结尾。

<!--    <<< 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM