Some configuration tasks must be performed directly after installation for your GlassFish Server environment to work as intended. For example, if you are using a database with GlassFish Server, you need to set up database connectivity right away.
Some configuration situations are ongoing and will require you to make changes many times during the life of your installation. You can use either the Administration Console or the asadmin utility to modify the configuration. Changes are automatically applied to the appropriate configuration file.
The following topics are addressed here:
This section maps the common configuration tasks to the command–line procedures in this guide. In some situations, the resource or service is automatically enabled and your configuration tasks involve adjusting or changing the default settings to suit your specific needs.
The following resources and services frequently require configuration immediately after installation:
The initial domain1 is created during installation. Additional configuration tasks might include such tasks as configuring additional domains or setting up automatic restart. See Chapter 3, Administering Domains.
The initial tasks for configuring the JVM include creating JVM options and profilers. See Chapter 4, Administering the Virtual Machine for the Java Platform.
By default, logging is enabled, so basic logging works without additional configuration. However, you might want to change log levels, property values, or the location of log files. See Chapter 7, Administering the Logging Service.
By default, the monitoring service is enabled. However, monitoring for the individual modules is not enabled, so your first monitoring task is to enable monitoring for the modules that you want to monitor. See Chapter 8, Administering the Monitoring Service.
System Security. Initial configuration tasks might include setting up passwords, audit modules, and certificates. See Chapter 11, Administering System Security.
User Security. Initial configuration tasks might include creating authentication realms and file users. See Chapter 12, Administering User Security.
Message Security. Initial configuration tasks might include configuring a Java Cryptography Extension (JCE) provider, enabling default and non-default security providers, and configuring message protection policies. See Chapter 13, Administering Message Security.
The initial tasks involved in configuring GlassFish Server to connect to the Java DB database include creating a Java Database Connectivity (JDBC) connection pool, creating a JDBC resource, and integrating a JDBC driver. See Chapter 14, Administering Database Connectivity .
The initial tasks involved in configuring GlassFish Server to connect to an enterprise information system (EIS) include creating a connector connection pool, creating a connector resource, editing a resource adapter configuration, creating a connector security map, creating a connector work security map, and creating an administered object (if needed). See Chapter 15, Administering EIS Connectivity.
The initial tasks involved in making deployed web applications accessible by internet clients include creating HTTP network listeners and virtual servers, and configuring the HTTP listeners for SSL (if needed). See Chapter 16, Administering Internet Connectivity.
An initial configuration task might involve creating an IIOP listener. See Chapter 17, Administering the Object Request Broker (ORB).
An initial configuration task might involve creating a JavaMail resource. See Chapter 18, Administering the JavaMail Service.
Initial configuration tasks might include creating a physical destination, creating connection factories or destination resources, creating a JMS host (if the default JMS host is not adequate), adjusting connection pool settings (if needed), and configuring resource adapters for JMS. See Chapter 19, Administering the Java Message Service (JMS).
An initial configuration task might involve creating a JNDI resource. See Chapter 20, Administering the Java Naming and Directory Interface (JNDI) Service.
Information and instructions for accomplishing the tasks by using the Administration Console are contained in the Administration Console online help.
After the initial configuration is working, you will continue to manage ongoing configuration for the life of your GlassFish Server installation. You might need to adjust resources to improve productivity, or issues might arise that require settings to be modified or defaults to be reset. In some situations, an asadmin subcommand is provided for updating, such as the update-connector-work-security-map subcommand. However, most updating is done by using the list, get, and set subcommands with dotted names. For detailed information about dotted names, see the dotted-names(5ASC) help page.
Dotted names also apply to monitoring, but the method is different. For information on using dotted names for monitoring, see How the Monitoring Tree Structure Works.
The general process for working with configuration changes on the command line is as follows:
List the modules for the component of interest.
The following single mode example uses the | (pipe) character and the grep command to narrow the search:
asadmin list "*" | grep http | grep listener
Information similar to the following is returned:
configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1 configs.config.server-config.network-config.network-listeners.network-listener.http-listener-2 configs.config.server-config.network-config.protocols.protocol.admin-listener.http configs.config.server-config.network-config.protocols.protocol.admin-listener.http.file-cache configs.config.server-config.network-config.protocols.protocol.http-listener-1 configs.config.server-config.network-config.protocols.protocol.http-listener-1.http configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.file-cache configs.config.server-config.network-config.protocols.protocol.http-listener-2 configs.config.server-config.network-config.protocols.protocol.http-listener-2.http configs.config.server-config.network-config.protocols.protocol.http-listener-2.http.file-cache configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl
Get the attributes that apply to the module you are interested in.
The following multimode example gets the attributes and values for http-listener-1:
asadmin> get server-config.network-config.network-listeners.network-listener.http-listener-1.*
Information similar to the following is returned:
server.http-service.http-listener.http-listener-1.acceptor-threads = 1 server.http-service.http-listener.http-listener-1.address = 0.0.0.0 server.http-service.http-listener.http-listener-1.blocking-enabled = false server.http-service.http-listener.http-listener-1.default-virtual-server = server server.http-service.http-listener.http-listener-1.enabled = true server.http-service.http-listener.http-listener-1.external-port = server.http-service.http-listener.http-listener-1.family = inet server.http-service.http-listener.http-listener-1.id = http-listener-1 server.http-service.http-listener.http-listener-1.port = 8080 server.http-service.http-listener.http-listener-1.redirect-port = server.http-service.http-listener.http-listener-1.security-enabled = false server.http-service.http-listener.http-listener-1.server-name = server.http-service.http-listener.http-listener-1.xpowered-by = true
Modify an attribute by using the set subcommand.
This example sets the security-enabled attribute of http-listener-1 to true:
asadmin> set server.http-service.http-listener.http-listener-1.security-enabled = true
The bulk of the configuration information about GlassFish Server resources, applications, and server instances is stored in the domain.xml configuration file. This file is the central repository for a given administrative domain and contains an XML representation of the GlassFish Server domain model. Default location for the domain.xml file is as-install/glassfish3/glassfish/domains/domain-name/config. For details on the domain.xml file, see Oracle GlassFish Server 3.0.1 Domain File Format Reference.
The logging.properties file is used to configure logging levels for individual modules. The file is located in the same directory as the domain.xml file. For further information on the logging.properties file, see Setting Log Levels.
The asenv.conf file is located in the as-install/glassfishv3/glassfish/config directory. It's purpose is to store the GlassFish Server environment variables, such as the installation location of the database, Message Queue, and so on.
Changes are automatically applied to the appropriate configuration file. Do not edit the configuration files directly. Manual editing is prone to error and can have unexpected results.
Configuration changes often require that you restart GlassFish Server for the changes to take effect. In other cases, changes are applied dynamically without requiring that GlassFish Server be restarted. The procedures in this guide indicate when you need to restart the server.
When making any of the following configuration changes, you must restart the server for the changes to take effect:
Changing JVM options
Changing port numbers
Changing log handler elements
Managing HTTP, JMS, IIOP, JNDI services
Creating or deleting resources (Exception: Some JDBC, JMS, or connector resources do not require restart.)
Modifying the following JDBC connection pool properties:
JDBC driver vendor-specific properties
Modifying the following connector connection pool properties:
With dynamic configuration, changes take effect while the server is running. To make the following configuration changes, you do not need to restart the server:
Adding or deleting add-on components
Adding or removing JDBC, JMS, and connector resources and pools (Exception: Some connection pool properties require restart.)
Adding file realm users
Changing logging levels
Enabling and disabling monitoring
Changing monitoring levels for modules
Enabling and disabling resources and applications
Deploying, undeploying, and redeploying applications