简体   繁体   English

一域多战

[英]One Domain with Multiple War

I have Two spring MVC web application(app1.war & app2.war), and both share the same DB. 我有两个spring MVC Web应用程序(app1.war和app2.war),并且它们共享同一个数据库。 Now I want host them on any cloud based hosting site(openshift, amazon etc.). 现在,我想将它们托管在任何基于云的托管站点(openshift,amazon等)上。 Here I want to host both inside one domain . 在这里,我想将两个都托管在一个域中

suppose my host name is - www.abc.com so 假设我的主机名是-www.abc.com,那么

  • abc.com --> will refer app1 abc.com- >将引用app1
  • spath .abc.com --> will refer app2 spath .abc.com->将引用app2

Please let me know, if it can possible,And How It can be done. 请让我知道,如果可能的话,以及如何完成。 Also where any hosting site also supporting this. 此外,任何托管网站也支持此功能。

You can easily achieve this by configuring your domain properly. 您可以通过正确配置域来轻松实现此目的。

Note that abc.com and spath.abc.com can be used to run two different websites. 请注意,可以使用abc.comspath.abc.com来运行两个不同的网站。 You will need to configure your domain's CNAME section and add a sub-domain there. 您将需要配置域的CNAME部分,并在其中添加一个子域。

Once that is done you can configure Apache Tomcat's Host Name. 完成后,您可以配置Apache Tomcat的主机名。 Taking DigitalOcean as your cloud provider, you can configure this easily by changing Tomcat configuration. 以DigitalOcean作为您的云提供商,您可以通过更改Tomcat配置轻松地进行配置。

You can then point abc.com to your app1.war and spath.abc.com to app2.war 然后,您可以将abc.com指向您的app1.war ,将spath.abc.com指向app2.war

Kindly comment if you face any issues. 如果您遇到任何问题,请发表评论。 I'll be happy to help you out here. 我很乐意为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM