使用 tomcat 客户端部署程序部署时出现 403 错误
我在本地 Tomcat 安装中使用 Tomcat Client Deployer (TCD) 时遇到一些问题。具体来说,我在尝试部署一个简单的 helloworld Web 应用程序时收到 403 错误,这使我得出结论:我的 tomcat-users.xml 有些问题。
我只是看不出它是什么。
这是相关的 build.xml 片段:
<!-- Configure the folder and context path for this application -->
<property name="webapp" value="helloworld"/>
<property name="path" value="/helloworld"/>
<!-- Configure properties to access the Manager application -->
<property name="url" value="http://localhost:8080/manager/text"/>
<property name="username" value="deploymgr"/>
<property name="password" value="s3cret"/>
tomcat-users.xml:
</tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="tomcat"/>
<user username="deploymgr" password="s3cret" roles="manager-script"/>
<user username="tomcat" password="tomcat" roles="tomcat, manager-gui, manager-jmx, manager-status"/>
</tomcat-users>
deployer.properties:
build=D:/apache-tomcat-7.0.16-deployer/work
webapp=D:/apache-tomcat-7.0.16-deployer/helloworld/
path=/helloworld
url=http://localhost:8080/manager
username=deploymgr
password=s3cret
当我尝试部署应用程序时,我收到以下错误消息:
D:\apache-tomcat-7.0.16-deployer>ant deploy
Buildfile: D:\apache-tomcat-7.0.16-deployer\build.xml
Trying to override old definition of datatype resources
deploy:
[echo] name: deploymgr, pass: s3cret, url: http://localhost:8080/manager
BUILD FAILED
D:\apache-tomcat-7.0.16-deployer\build.xml:92: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/manager/deploy?path=%2Fhelloworld&update=true
我唯一觉得奇怪的是错误消息 URL 包含“%2F” “而不是正斜杠...难道用户配置实际上是正确的,我只是因为 URL 转义码而得到 403? (我在 Windows Vista 下工作)
有人可以帮我解决这个问题吗?哦,当然,应用程序通过用户界面完美部署:-1
提前非常感谢。
I have some trouble using Tomcat Client Deployer (TCD) with a local Tomcat installation. Specifically, I get a 403 error while trying to deploy a simple helloworld web application which leads me to the conclusion that something is not quite right with my tomcat-users.xml.
I just cannot see what it is.
here's the relevant build.xml snippet:
<!-- Configure the folder and context path for this application -->
<property name="webapp" value="helloworld"/>
<property name="path" value="/helloworld"/>
<!-- Configure properties to access the Manager application -->
<property name="url" value="http://localhost:8080/manager/text"/>
<property name="username" value="deploymgr"/>
<property name="password" value="s3cret"/>
tomcat-users.xml:
</tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="tomcat"/>
<user username="deploymgr" password="s3cret" roles="manager-script"/>
<user username="tomcat" password="tomcat" roles="tomcat, manager-gui, manager-jmx, manager-status"/>
</tomcat-users>
deployer.properties:
build=D:/apache-tomcat-7.0.16-deployer/work
webapp=D:/apache-tomcat-7.0.16-deployer/helloworld/
path=/helloworld
url=http://localhost:8080/manager
username=deploymgr
password=s3cret
and when I try to deploy the application, I get the following error message:
D:\apache-tomcat-7.0.16-deployer>ant deploy
Buildfile: D:\apache-tomcat-7.0.16-deployer\build.xml
Trying to override old definition of datatype resources
deploy:
[echo] name: deploymgr, pass: s3cret, url: http://localhost:8080/manager
BUILD FAILED
D:\apache-tomcat-7.0.16-deployer\build.xml:92: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/manager/deploy?path=%2Fhelloworld&update=true
only thing I find weird is that the error message URL contains a "%2F" instead of a forward slash... could it be that the user configuration is actually correct, I get the 403 simply because of the URL escape code? (I'm working under Windows Vista)
Can someone help me out on this? Oh, and of course the application deploys flawlessly through the user interface :-1
Thanks very much in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许是关于这个问题的更新...我在deployer.properties文件中犯了一个错误。参数“url”必须与上面的 build.xml 中的相同。
正确的deployer.properties:
现在可以了!
perhaps an update on this issue... I've made a mistake in the deployer.properties file. The parameter "url" has to be the same as in build.xml above.
deployer.properties correctly:
now it works!