【问题标题】:Deploying war file to remote tomcat 8 using curl使用curl将war文件部署到远程tomcat 8
【发布时间】:2017-08-13 00:15:44
【问题描述】:

我想从远程机器 A 向运行 tomcat 的机器 B 部署战争

我在机器 B 上的 tomcat-users.xml 中设置了以下内容

<role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="tomcat" password="tomcat" roles="manager-gui,manager-script"/>

从机器 A,我运行了以下命令

$ curl -T "test.war" "http://tomcat:tomcat@<machine b>:8080/manager/text/deploy?path=/temp&update=true" -v
*   Trying machine B IP...
* Connected to (machine B IP) port 8080 (#0)
* Server auth using Basic with user 'tomcat'
> PUT /manager/text/deploy?update=true HTTP/1.1
> Host: <machine b>:8080
> Authorization: Basic dG9tY2F0OnRvbWNhdA==
> User-Agent: curl/7.47.0
> Accept: */*
> Content-Length: 374778991
> Expect: 100-continue
>
< HTTP/1.1 404 Not Found
< Server: Apache-Coyote/1.1
< Content-Length: 0
< Date: Sun, 13 Aug 2017 00:12:37 GMT
* HTTP error before end of send, stop sending
<
* Closing connection 0

我尝试打开管理器页面 http:&lt;machine b&gt;8080/manager/html,但打不开。我不确定我是否缺少任何配置或上下文路径不正确。

【问题讨论】:

  • 打开管理页面会出现什么错误?
  • 找不到 404
  • 可以访问http://&lt;machine b&gt;:8080吗?
  • 是的,我可以访问它。
  • webapps 目录中是否存在具有相应权限的管理器应用程序?

标签: tomcat curl deployment


【解决方案1】:

我通过在ubuntu上下载tomcat6-admin,然后将manager目录复制到原tomcat 8的webapps文件夹中解决了。

【讨论】:

    猜你喜欢
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多