By default, when GlassFish Server starts, the following virtual servers are started automatically:
A virtual server named server, which hosts all user-defined web modules.
For development, testing, and deployment of web services in a non-production environment, server is often the only virtual server required.
A virtual server named __asadmin, which hosts all administration-related web modules (specifically, the Administration Console). This server is restricted, which means that you cannot deploy web modules to this virtual server.
In a production environment, additional virtual servers provide hosting facilities for users and customers so that each appears to have its own web server, even though there is only one physical server.
Use the create-virtual-server subcommand in remote mode to create the named virtual server.
A virtual server must specify an existing HTTP listener. Because the virtual server cannot specify an HTTP listener that is already being used by another virtual server, create at least one HTTP listener before creating a new virtual server.
Ensure that the server is running.
Remote subcommands require a running server.
Create a virtual server by using the create-virtual-server(1) subcommand.
Information about properties for this subcommand is included in this help page.
To apply your changes, restart GlassFish Server.
See To Restart a Domain.
This example creates a virtual server named sampleServer on localhost.
asadmin> create-virtual-server sampleServer Command create-virtual-server executed successfully. |
You can also view the full syntax and options of the subcommand by typing asadmin help create-virutal-server at the command line.