glassfish主机名映射 [英] glassfish hostname mapping

查看:147
本文介绍了glassfish主机名映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用glassfish,我想将foo.domain.com映射到一个上下文,并将bar.domain.com映射到另一个上下文。有没有一种纯粹的配置方式来完成这项工作? 解决方案

按照这里并将您的网络应用分配给他们。



例子:

< http-service> 元素:

 < virtual-server id =foo.domain.comhosts =foo.domain .comnetwork-listeners =http-listener-1/> 

然后编辑中的http-listener-1设置< network- config> 元素。更改端口号,如果侦听器应该侦听不同的端口:

 < protocol name =http-listener-1 > 
< http default-virtual-server =foo.domain.commax-connections =250server-name =foo.domain.com:8080>
...
< / protocol>

最后,将虚拟服务器设置为您的Web应用程序的默认值(位于< ;服务器> 元素。将app-name替换为您的webapp的名称:

 < application -ref ref =app-namevirtual-servers =foo.domain.com/> 


with glassfish, i'd like to map say foo.domain.com to one context, and bar.domain.com to another context. is there a purely config way to accomplish this?

解决方案

Configure virtual servers as described here and assign your web-apps to them.

Example:

Add the following in the domain.xml inside the <http-service> element:

<virtual-server id="foo.domain.com" hosts="foo.domain.com" network-listeners="http-listener-1" />

Then edit the http-listener-1 setting in the <network-config> element. Change the port number, if the listener should listen to a different port:

<protocol name="http-listener-1">
   <http default-virtual-server="foo.domain.com" max-connections="250" server-name="foo.domain.com:8080">
   ...
</protocol>

Finally set the virtual server as default for your web application (in the <server> element. Replace app-name with the name of your webapp:

<application-ref ref="app-name" virtual-servers="foo.domain.com" />

这篇关于glassfish主机名映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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