846 WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile
Figure 23-26 Exporting to an EAR file
3. Click Finish.
The EAR file that you export is now prepared for installation in WebSphere Application Server
V8.5.
23.6 Preparing the runtime environment for the application
In this section, we show you how to set up a complete environment for the ITSO Bank
application and how to deploy the EAR file. You will not always need or want to customize the
environment as extensively as we do in this example. Some steps are optional. If all you want
to do is deploy your application quickly, using the WebSphere defaults for directory names,
log files, and so on, skip to 23.7, “Deploying the application” on page 855.
To deploy the ITSO Bank application:
1. Optional: Create an environment variable for the application file directory.
2. Optional: Create an application server to host the application.
3. Optional: Customize the IBM HTTP Server configuration.
4. Define a JDBC provider, data source, and authentication alias. If you are using an
enhanced EAR file, this step is optional.
5. Define virtual hosts. If you are using an enhanced EAR file, this step is optional.
If the application to be deployed is a WebSphere enhanced EAR file, the resources
configured in the enhanced EAR file are created automatically when the application is
Version note: If you select the Optimize for a specific server runtime option, the
application runs only on the version that you specify or on later versions. In this case, for
example, the application will not run on WebSphere Application Server V8 if you select this
option.
Chapter 23. Packaging and deploying Java EE applications 847
deployed. The resources that can be configured in the enhanced EAR are described in the
following sections.
23.6.1 Creating an environment variable for the application file directory
Use WebSphere environment variables, rather than hardcoded paths, when deploying an
application. In this step, a variable called ITSOBANK_ROOT is defined. The variable represents
the root directory where application resources are stored. You use this variable in subsequent
configuration processes when specifying, for example, the JVM log location.
Complete the following steps to specify the log location:
1. Determine how you want to organize your application files.
There are several ways to organize WebSphere applications. You can create a directory
for each application, such as /apps/application_name, and keep all resources and
directories that are required by the application in subdirectories under this directory. This
strategy works well when deploying only one application per application server because
the application server’s log files can then all be changed to point to the
/apps/application_name/logs directory.
An alternative is to organize resources by resource type and create directories, such as
/apps/logs/application_name.log, /apps/properties/application_name.properties,
and so on.
Finally, you can keep the vendor defaults as much as possible. For WebSphere, vendor
defaults mean that the applications are installed in the profile_root/installedApps
directory and that the logs files are written to the profile_root/logs/server_name
directory.
The option that you choose is a matter of personal preferences and corporate guidelines.
In this example, we deploy a single application to a single application server. A directory
called /apps/ITSOBANK will be used to contain the application resources.
2. Create the target directory on the application server operating system:
/apps/ITSOBANK
3. Use the steps that are described in 6.1.10, “Using variables” on page 205 to create an
ITSOBANK_ROOT variable with a value of /apps/ITSOBANK.
Be certain that you declare this variable at the correct scope. For example, if you define this
variable at the application server scope, it is known only at that level. As long as you work with
the WebSphere Application ServerBase or Express editions, this configuration is fine.
However, if you are using the Network Deployment edition and you create a cluster of
application servers, you need to define the ITSOBANK_ROOT variable at the cluster or cell level.
23.6.2 Creating the ITSO Bank application server
In a distributed server environment, you can use a single application server or create multiple
application servers or clusters.
The advantage of deploying multiple applications to a single application server is that it
consumes less resources. There is no impact for any extra application server processes.
Important: If you define and use the variable in configuration steps, but the directory is
not created, the application server might not start.

Get WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.