I have a Grails app called abc, which when I access locally I get at through
http://localhost:port/abc
I have deployed my app up on Amazon EC2 with an elastic IP address which I can get at directly as
http://1.2.3.4/abc
I have a domain name of xyz.com and I have pointed that at my elastic IP, so n开发者_如何学编程ow I can go to
http://xyz.com
http://www.xyz.com
The problem is that xyz.com points at the root folder for the tomcat server. What I want it to do is map the .com domains to http://1.2.3.4/abc
so that my home page shows instead of the tomcat welcome screen.
What's the best way to do this? Should I reconfigure the domain name mapping somehow or should I change the tomcat settings somehow or something else?
Thanks
If you rename the war file to ROOT.war (case sensitive) then when you deploy it to Tomcat it will be the root context at http://1.2.3.4/ and http://www.xyz.com will work.
If you also want to run your local app with the root context add this line to application.properties
app.context=/
and then 'grails run-app' will run at http://localhost:8080/
You can create Virtual Hosts in Tomcat. The do a pretty good job of explaining it on the linked page so I won't try to paraphrase here.
精彩评论