在域中部署Java Web应用程序war文件 [英] Deploy Java web application war file in domain

查看:93
本文介绍了在域中部署Java Web应用程序war文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个Java Web应用程序,并生成了两个不同的环境war文件名,分别是test.war和prod.war文件.

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

我想在域中发布战争文件.所以我买了域名.例如:-www.example.com

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

我想将我的战争文件在域中发布为"www.test.example.com"和"www.prod.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 ?

推荐答案

是的.

您已购买了最后一部分domain.com,然后需要将DNS配置为将www.test.example.comwww.prod.example.com指向您拥有的计算机的IP(每个域可以有一台计算机).

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).

如果您有tomcat,则可以部署两台虚拟主机,每台虚拟主机响应一个域,并具有自己的war部署

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>

这篇关于在域中部署Java Web应用程序war文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆