After installing GlassFish Server and creating the default domain (domain1), you can create additional domains by using the local create-domain subcommand. This subcommand creates the configuration of a domain. Any user who has access to the asadmin utility on a given system can create a domain and store the domain configuration in a folder of choice. By default, the domain configuration is created in the default directory for domains. You can override this location to store the configuration elsewhere.
Determine which profile will apply to the domain.
Select a name for the domain that you are creating.
You can verify that a name is not already in use by using the list-domains(1) subcommand
Create a domain by using the create-domain(1) subcommand.
Information about the options for this subcommand is included in this help page.
Type an admin user name and password for the domain.
To avoid setting up an admin login, you can accept the default admin, with no password. Pressing Return also selects the default.
This example creates a domain named domain1 . When you type the command, you might be prompted for login information.
asadmin> create-domain --adminport 4848 domain1 Enter admin user name[Enter to accept default]> Using port 4848 for Admin. Default port 8080 for HTTP Instance is in use. Using 1161 Using default port 7676 for JMS. Using default port 3700 for IIOP. Using default port 8081 for HTTP_SSL. Using default port 3820 for IIOP_SSL. Using default port 3920 for IIOP_MUTUALAUTH. Default port 8686 for JMX_ADMIN is in use. Using 1162 Distinguished Name of the self-signed X.509 Server Certificate is: [CN=moonbeam.gateway.2wire.net,OU=GlassFish,O=Oracle Corp.,L=Redwood Shores,ST California,C=US] Domain domain1 created. Command create-domain executed successfully.
To start the Administration Console in a browser, enter the URL in the following format:
For this example, the domain’s log files, configuration files, and deployed applications now reside in the following directory:
You can also view the full syntax and options of the subcommand by typing asadmin help create-domain at the command line.