Tomcat8 use the app as ROOT.war

烂漫一生 提交于 2019-12-13 09:36:35

问题


I was working with Tomcat7 on GoDaddy server, and in order to use my app as the ROOT context, I deleted the ROOT folder that was there and moved my app which I called it ROOT.war and was deployed to ROOT folder.

I tried the same approach, now with tomcat8 on Amazon ubuntu server, but it doesn't work.

When I navigate to myip:8080/ I get error in the javascript console that it's not found and navigating to myip:8080/index.html gives me an empty page.

What is the difference between tomcat8 and tomcat7?


回答1:


Your app url is:

host:8443/yourApp/login.html

But you want it in live as

host:8443/login.html

If this is the case then no need to make it as ROOT.war

you just add some line in conf/server.xml

<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
    <Context docBase="usr/apache-tomcat/webapps/YourAppName" path="" reloadable="true" />
</Host>

And you just hit

host:8443

In browser there is..

host:8443/login.html

Hope it helps you :)



来源:https://stackoverflow.com/questions/27970008/tomcat8-use-the-app-as-root-war

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!