[英]Tomcat 8 Manager, HTML and Text running, access from ANT Connection Refused
first time poster here. 第一次海报在这里。 I'm setting up a new Tomcat 8 instance and I'm trying to utilize tomcat 8 manager from my build.xml script (via IntelliJ). 我正在设置一个新的Tomcat 8实例,并试图通过我的build.xml脚本(通过IntelliJ)利用tomcat 8管理器。 I'm using the list command to test the connection, but want I really want is stop/start/redeploy/etc. 我正在使用list命令测试连接,但是我真正想要的是stop / start / redeploy / etc。 I've tested both manager/text/ and manager/html succesfully. 我已经成功测试了manager / text /和manager / html。
[Windows 7 box] [Windows 7框]
Code snippets incoming tomcat-users.xml: 传入tomcat-users.xml的代码段:
<role rolename="admin-gui"/>
<role rolename="manager-script" />
<role rolename="manager-gui" />
<user username="script" password="test" roles="admin-gui,manager-script"/>
<user username="manager" password="test" roles="admin-gui,manager-gui"/>
build.xml: build.xml文件:
<target name="list"
description="List installed applications on servlet container">
<echo>List Using:(${manager.url}) [${manager.username}|${manager.password}]</echo>
<list url="${manager.url}"
username="${manager.username}"
password="${manager.password}"/>
</target>
Output from 'list' task from IntelliJ: 来自IntelliJ的“列表”任务的输出:
List Using:(http://localhost:8080/manager/text) [script|test]
Task: list
C:\apps\myapp\build.xml:478: java.net.ConnectException: Connection refused: connect
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:269)
...etc
Every tutorial I go to talks about setting up Tomcat-Users.xml or opening port 8443 for the manager, but I haven't seen an answer for what to do if you have confirmed manager is running (it is) but build.xml/ANT seem have trouble getting authorized. 我要阅读的每个教程都讨论了设置Tomcat-Users.xml或为管理器打开端口8443的问题,但是如果您确认管理器正在运行,则没有找到答案,但是build.xml / ANT似乎很难获得授权。
Things to check: 检查事项:
Have you actually confirmed that manager app is deployed to the /manager
context? 您是否确实确认了经理应用已部署到/manager
上下文? It's only deployed by default on the default host. 默认情况下,它仅部署在默认主机上。 For other virtual hosts, this is something you must do manually. 对于其他虚拟主机,这是您必须手动执行的操作。 Try visiting http://localhost:8080/manager
with your web browser. 尝试使用网络浏览器访问http://localhost:8080/manager
。 Try logging in with the manager-gui
user. 尝试使用manager-gui
用户登录。
Does your tomcat instance run more than one virtual host? 您的tomcat实例是否运行多个虚拟主机? If so, it's possible that your ant task is hitting a different virtual host than one you want. 如果是这样,可能是您的ant任务遇到了与所需虚拟主机不同的虚拟主机。 Check your $CATALINA_HOME/conf/server.xml
file's <Engine>
and <Host>
elements. 检查$CATALINA_HOME/conf/server.xml
文件的<Engine>
和<Host>
元素。 Does <Engine>
contain just one <Host>
? <Engine>
仅包含一个<Host>
吗? If it contains multiple hosts, whate are the name
attributes set to? 如果它包含多个主机,则name
属性设置为什么? What is the defaultHost
attribute of <Engine>
set to? <Engine>
的defaultHost
属性设置为什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.