This is in response to the following email from Dyego Souza Dantas Leal
about virtual domains.
https://glassfish.dev.java.net/servlets/ReadMsg?list=admin&msgNo=10
Yes, it is possible to create virtual domains on GlassFish. For the
example quoted in email, following configuration in domain.xml should work.
<config dynamic-reconfiguration-enabled="true" name="server-config">
<http-service>
...
<http-listener acceptor-threads="1" address="200.200.200.200"
blocking-enabled="false" default-virtual-server="jose" enabled="true"
family="inet" id="port80" port="80" security-enabled="false"
server-name="" xpowered-by="true">
</http-listener>
<http-listener acceptor-threads="1" address="200.200.200.200"
blocking-enabled="false" default-virtual-server="jose" enabled="true"
family="inet" id="port443" port="443" security-enabled="true"
server-name="" xpowered-by="true">
</http-listener>
...
<virtual-server hosts="www.jose.org,jose.org"
http-listeners="port80,port443" id="jose"
log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
<property name="docroot"
value="${com.sun.aas.instanceRoot}/docroot"/>
<property name="accesslog"
value="${com.sun.aas.instanceRoot}/logs/access"/>
</virtual-server>
<virtual-server hosts="www.maria.org,maria.org"
http-listeners="port80,port443" id="maria"
log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
<property name="docroot"
value="${com.sun.aas.instanceRoot}/docroot"/>
<property name="accesslog"
value="${com.sun.aas.instanceRoot}/logs/access"/>
</virtual-server>
...
</http-service>
...
</config>
To summarize, you need to have two virtual server entries, one for each
URL you are trying to serve. The example above also assumes that you are
going to serve both http and https, so there are two different http
listeners, one for port 80 and another for port 443.
I am sure someone on this list can post instructions on how to do it
using admin console or command line interface.
Please try it out and let us know if it worked.
Hope this helps,