How to change domain name in Glassfish generated urls?

*爱你&永不变心* 提交于 2019-12-05 19:51:20

Matt Handy's answer did not work for me. However, the solution that Matt gave in his comment to his answer did the trick. I'm repeating it here to give it more weight. There are two ways to do this:

  1. Set the server name for the HTTP listener in GlassFish admin console: Configurations > server-config > Network Config > Network Configuration > Network listeners > http-listener-1 > Tab "HTTP" > "Server name".
  2. Edit domain.xml, more specifically the server-name attribute in

    <network-config>
      <protocols>
        <protocol name="http-listener-1">
          <http server-name="">

You can change the host name with the Glassfish admin console:

Configuration --> Virtual Servers --> Your server's name (usually: "server")

If you click on the virtual server, a page opens, containing an input field "Hosts". By default this should contain ${com.sun.aas.hostName}.

Change it to your host's name.

Be careful if you have other webapps on your server. If you only want to change the hostname for a particular application and not for all, you have to create a new virtual server and assign the host nameto it.

Alternatively you could get the same by editing domain.xml in your domain/config dir. But I think you will be faster with the (often bashed and often slow) admin console.

To Change the Default Host Name Using the asadmin Command

asadmin set server-config.jms-service.jms-host.default_JMS_host.host="0.0.0.0"

or you can set hostname

asadmin set server-config.jms-service.jms-host.default_JMS_host.host="hostname"

You can get more information from this link:

http://docs.oracle.com/cd/E19798-01/821-1841/gjsdi/index.html

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