问题
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