9. Configuring the SpringSource dm Server

You use configuration files in the SERVER_HOME/config directory to configure dm Server. This section divides the configuration of the server into the following high-level tasks:

9.1 Configuring the dm Kernel and User Region

This section provides information about configuring the dm Server kernel and the user region by updating the following files in the SERVER_HOME/config directory:

Table 9.1. Kernel Configuration Files

Property FileDescription
com.springsource.kernel.propertiesConfigures kernel deployment and the dm Shell of dm Server.
com.springsource.kernel.userregion.propertiesConfigures the user region of dm Server.
com.springsource.kernel.users.propertiesConfigures the users that are allowed to access the dm Shell and Admin Console, and roles to which they map.
com.springsource.kernel.jmxremote.access.propertiesConfigures the permissions for users that are allowed to access the dm Shell and Admin Console.
com.springsource.kernel.authentication.configConfigures the Java Authentication and Authorization Service (JAAS) for the Tomcat server users.

Configuring Deployment

You can configure three properties of deployment: the pickup directory into which you copy applications for hot-deployment, the deployment timeout, and whether automatic cloning of deployed bundles is enabled.

To change any of these properties, edit the deployer.XXX properties of the SERVER_HOME/config/com.springsource.kernel.properties file. The following table describes these properties.

Table 9.2. Deployment Configuration Properties

PropertyDescription
deployer.timeoutSpecifies the amount of time, in seconds, after which dm Server times out while trying to deploy a bundle, library, or plan. The default value is 300. If you want to disable deployment timeout, specify 0.
deployer.pickupDirectorySpecifies the absolute or relative path to the pickup directory to which you copy applications for hot-deployment. Relative paths are relative to SERVER_HOME. The default value is ./target/pickup..

The following listing displays the default configuration distributed with the dm Server; only relevant sections of the com.springsource.kernel.properties file are shown.

deployer.timeout=300
deployer.pickupDirectory=pickup

As the default configuration shows, the default pickup directory is SERVER_HOME/pickup and the deployment timeout is 300 seconds.

Configuring the dm Shell

The dm Shell is a command line utility that allows you to examine artifacts currently installed to a particular dm Server instance, manage the lifecycle of the installed artifacts, install new artifacts, and shutdown the server. For complete documentation on the dm Shell, see Chapter 4, The dm Shell.

You configure the dm Shell by updating the shell.XXX properties in the SERVER_HOME/config/com.springsource.kernel.properties file, as described in the following table:

Table 9.3. dm Shell Configuration Properties

PropertyDescription
shell.enabledSpecifies whether the dm Shell is enabled or not. Valid values are true or false.
shell.portDefines the port on which you can remotely access the dm Shell. If not set, the shell is only available from stdout of the dm Server process.

The following example shows the default dm Shell configuration in a freshly-installed com.springsource.kernel.properties file; only the relevant section of the file is shown.

shell.enabled=true
shell.port=2401

The example shows that the dm Shell is enabled by default, and you connect to it remotely using the port 2401.

Configuring the User Region

The user region is the subsystem of dm Server that supports deployed applications, both your own user applications and those of the server itself, such as the Admin Console. The user region is deliberately isolated from the kernel, which makes it much simpler for you to manage your applications with the Admin Console or dm Shell because the internal server bundles are not visible.

You configure the user region by updating properties in the SERVER_HOME/config/com.springsource.kernel.userregion.properties file; these properties are described in the following table.

WARNING: SpringSource strongly recommends that you update only the initialArtifacts property; updating the other properties could cause dm Server to fail. These properties are documented for your information only.

Table 9.4. User Region Configuration Properties

PropertyDescription
baseBundlesSpecifies the hard-coded list of bundles that dm Server installs directly into the user region. SpringSource dm Server does not perform any automatic dependency satisfaction for these bundles; in other words, you only get the bundles in the list and nothing more.
packageImportsSpecifies the packages that exist in the kernel that dm Server imports into the user region so that they are in turn available to be imported by bundles in the user region. This property supports a .* wildcard. For example, com.springsource.util.* will import all packages that start with com.springsource.util.
serviceImportsSpecifies the services in the kernel that are imported into the user region so that they're available to bundles in the user region.
serviceExportsSpecifies the services in the user region that are imported into the kernel so that they're available to bundles in the kernel.
inheritedFrameworkPropertiesSpecifies the framework properties, configured in the SERVER_HOME/lib/com.springsource.kernel.launch.properties file, that will also be set on the user region's nested framework.
initialArtifactsSpecifies the artifacts that dm Server deploys into the user region when the server starts. SpringSource dm Server performs dependency satisfaction when it deploys these artifacts. This means that you only need to list the top-level artifacts that you care about; dm Server automatically installs any other artifacts upon which they depend from the repository.

You can use this property to convert a dm Server into a dm Kernel by removing the repository:plan/com.springsource.server.web plan.


Configuring Authentication

SpringSource dm Server uses the Java Authentication and Authorization Service (JAAS) framework to authenticate the administration user that connects to dm Servers using the Admin Console or dm Shell. This section describes how the authentication mechanism is configured by default, and the files that you need to update if you want to change the administration user, change their password, and so on.

The SERVER_HOME/config/com.springsource.kernel.authentication.config file configures the underlying authentication technology for dm Server. The short file consists of the following entry:

dm-kernel {
        com.springsource.kernel.authentication.KernelLoginModule REQUIRED;
};

The entry is named dm-kernel. This name corresponds to the <Realm> element in the SERVER_HOME/config/tomcat-server.xml file that configures the JAAS authentication mechanism for the Catalina service of the Tomcat servlet container. The dm-kernel entry specifies that the JAAS LoginModule that dm Server uses to authenticate users is com.springsource.kernel.authentication.KernelLoginModule and that this KernelLoginModule is required to "succeed" in order for authentication to be considered successful. The KernelLoginModule succeeds only if the name and password supplied by the user are the ones it expects. The default administration username/password pair for dm Server is admin/springsource.

You configure the administration user in the com.springsource.kernel.users.properties file. The default file for a freshly installed dm Server is as follows:

##################
# User definitions
##################
user.admin=springsource

##################
# Role definitions
##################
role.admin=admin

The administration user that connect to the Admin Console and dm Shell must have the admin role. The preceding file shows how, by default, the admin role is assigned the admin user with password springsource.

If you want to change the administration user, update the com.springsource.kernel.users.properties file. For example, if you want the juliet user, with password supersecret, to be the new adminstration user, update the file as shown:

##################
# User definitions
##################
user.juliet=supersecret

##################
# Role definitions
##################
role.admin=juliet

Be sure to restart dm Server after you make this change for it to take effect.

The final file involved in dm Server authentication is SERVER_HOME/config/com.springsource.kernel.jmxremote.access.properties. This file specifies the JMX access privileges that the administration user has; by default they are read and write, as shown in the following listing:

admin=readwrite

The only other value you can enter is readonly, which means that the adminstration user would only be able to view information using the Admin Console and dm Shell.