Deploy Java web application war file in domain

偶尔善良 提交于 2019-12-08 10:20:10

问题


I developed a java web application and generated 2 different enviroment war files names as test.war and prod.war file.

I want to publish the war file in the domain. so i bought the domain. for ex:- www.example.com

and I want to publish my war files in domain as "www.test.example.com" and www.prod.example.com ". Is this possible to do this ?


回答1:


Yes it is possible.

You has bought the last part domain.com , then you need to configure DNS to point www.test.example.com and www.prod.example.com to an IP of a machine owned by you (you can have one machine for each domain).

If you have tomcat then you can deploy two virtual hosts, each one responding to a domain, with its own war deployment

<Engine name="Catalina" defaultHost="www.test.example.com">

  <Host name="www.test.example.com"  appBase="test"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
  </Host>

  <Host name="www.prod.example.com"  appBase="prod"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">

        <Alias>example.com</Alias>
  </Host>
</Engine>



回答2:


Domain is public address which has a public IP.First purchase a platform in which jvm and application container should be available.After that you can configure your deployment descriptor for sub domain



来源:https://stackoverflow.com/questions/41839278/deploy-java-web-application-war-file-in-domain

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