Tomcat 部署应用程序问题(HTTP Status 403 – Forbidden) [英] Tomcat deploy application issue (HTTP Status 403 – Forbidden)
问题描述
我在使用 Tomcat 8.5.12 的服务器上部署应用程序时遇到问题.我的 tomcat-users.xml 文件:
I have a problem with deploying application on server with Tomcat 8.5.12. My tomcat-users.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
</tomcat-users>
当我通过 ./catalina.sh start 启动 tomcat 时,我可以看到 Tomcat 站点,但在单击 Manager App 后出现错误:
and when I start tomcat by ./catalina.sh start I can see Tomcat site but after click on Manager App I got an error:
HTTP Status 403 – Forbidden
Type Status Report
Description The server understood the request but refuses to authorize it.
Tomcat 似乎不认识我的用户,但我尝试更改 tomcat-users.xml 没有成功.
It seems that Tomcat doesn't know my user but I tried to change tomcat-users.xml without success.
推荐答案
我猜,你想从另一个主机部署,那么你必须配置一个上下文.
I guess, you want to deploy from another host, then you have to configure a context.
我上次遇到了同样的问题,我的解决方案是:
I had the same issue last time and there is my solution:
使用以下内容创建文件/{tomcat_path}/conf/Catalina/localhost/manager.xml
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
这篇关于Tomcat 部署应用程序问题(HTTP Status 403 – Forbidden)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!