tomcat服务器应用程序路径问题
我使用 tomcat 6 进行生产。我在此服务器上部署了一个 Web 应用程序,名为:app.war 它有一个网址:test.org。
每次当我取消部署 app.war 并重新部署它时,这条路径将不再起作用 http://test.org/home
但此网址始终有效:http://test.org/app/home。
为了使第一个网址工作,我需要重新启动 tomcat 服务器。
我想知道为什么当我重新部署 app.war 时,网址 http://test.org/home 不起作用。
有没有办法让它一直工作而不需要重新启动服务器? 我不希望应用程序名称包含在网址中,
谢谢
i use tomcat 6 for production. i have a web app deployed on this server called: app.war
it has a url : test.org.
every time when i undeploy app.war and redeploy it this path won't work any more
http://test.org/home
but this url always work: http://test.org/app/home.
to make the first url work, i need to restart the tomcat server.
i wonder why when i redeploy the app.war the url http://test.org/home does not work.
if there a way to make it always work without restarting the server?
i don't want the application name to be included in the url
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看 ${TOMCAT_HOME}/conf/Catalina/localhost 中的 app.xml 。当您尝试重新部署此文件时,该文件可能会被删除并重新创建,从而导致出现问题。
Check out your app.xml in ${TOMCAT_HOME}/conf/Catalina/localhost . Whe you try to redeploy this file might get deleted and gets recreated causing you the problem.
在您的 war 文件中,尝试在顶层创建一个 META-INF 文件夹(与 WEB-INF 位于同一目录中),并在 META-INF 文件夹中创建一个文件
context.xml
。在context.xml
中输入以下内容:看看这是否适合您。
In your war file try creating a folder META-INF at the top level (in the same directory as WEB-INF) and creating a file
context.xml
in the META-INF folder. Incontext.xml
put this:See if that works for you.
这个问题没有简单的答案,因为涉及到很多组件。您应该隔离问题。例如,您可以开始删除 test.org 域映射,确保没有组件可能缓存输出等。
然后,在将 Tomcat 与其他任何东西隔离后,如果问题仍然存在,您可以说这是 Tomcat 问题。
因此,当您完成这些步骤后,请 (pleeeeeeease) 完善您的问题,以便 SO 社区可以帮助您。
抱歉回复太长。
This has no simple answer, as there are many components involved. You should isolate the problem. For instance, you could start removing test.org domain mapping, ensuring that there's no component possibly caching the output and so on.
And then after you had isolated Tomcat from anything else, if the problem persist, you could state that this is a Tomcat problem.
So please (pleeeeeeease) refine your question when you have done a couple of these steps so the SO community can help you.
Sorry for the long response.