Preparing Applications and Modules for Deployment 3-5
Figure 3–1 Application Installation Directory
Oracle recommends copying all new production deployments into an application installation directory before deploying to a WebLogic Server domain. Deploying from
this directory structure helps you easily identify all of the files associated with a deployment unit—you simply deploy the installation root using the Administration
Console, and the Console automatically locates associated files such as deployment plans and WebLogic Server deployment descriptors that were generated during
configuration.
3.5.1 Steps for Creating an Application Installation Directory
To create an application installation directory:
1. Choose a top-level directory where you want to store deployment files for
applications and modules on your system. Follow these best practices:
■
Do not store deployment files within a WebLogic Server domain directory.
■
Use source control if available to maintain deployment source files.
■
If possible, store deployment files in a directory that is accessible by the Administration Server and Managed Servers in your domain.
The instructions that follow use the sample deployment directory, c:\deployments\production.
2. Create a dedicated subdirectory for the application or module you want to deploy:
mkdir c:\deployments\production\myApplication
3. Create a subdirectory beneath the application directory to designate the version of
the application you are deploying. Name the subdirectory using the exact version string of the application. For example:
mkdir c:\deployments\production\myApplication\91Beta
3-6 Deploying Applications to Oracle WebLogic Server
4.
The version subdirectory will become the installation root directory from which you deploy the directory. Create subdirectories named app and plan under the
version subdirectory:
mkdir c:\deployments\production\myApplication\91Beta\app mkdir c:\deployments\production\myApplication\91Beta\plan
5.
Copy your application source deployment files into the \app subdirectory. If you are deploying from an archive file, simply copy the archive file, as in:
cp c:\downloads\myApplication.ear c:\deployments\production\myApplication\91Beta\app
If you are deploying from an exploded archive directory, copy the complete exploded archive directory into \app:
cp -r c:\downloads\myApplication c:\deployments\production\myApplication\91Beta\app
This results in the new directory, c:\deployments\production\myApplication\91Beta\app\myApplicat
ion.
6.
If you have one or more deployment plans for the application, copy them into the \plan subdirectories.
If you have one deployment plan for the application: cp c:\downloads\myApplicationPlans\plan.xml
c:\deployments\production\myApplication\91Beta\plan If you have two deployment plans for the application:
cp c:\downloads\myApplicationPlans\plan1.xml c:\deployments\production\myApplication\91Beta\plan1
cp c:\downloads\myApplicationPlans\plan2.xml c:\deployments\production\myApplication\91Beta\plan2
Note: If you have more than one deployment plan associated with the
application, create one \plan subdirectory for each plan. For example, if you have two deployment plans associated with the 91Beta version of the
application myApplication, you would create two \plan subdirectories. For instance:
■
mkdir c:\deployments\production\myApplication\91Beta\plan1
■
mkdir c:\deployments\production\myApplication\91Beta\plan2
Note: If you do not have an existing deployment plan, you can create one
using the Administration Console as described in Chapter 4, Configuring
Applications for Production Deployment . The Administration Console
automatically stores newly-generated deployment plans in the \plan subdirectory of the application installation directory.
Preparing Applications and Modules for Deployment 3-7
7.
To install the application using Administration Console, select the application installation directory. By default, the Administration Console will use a plan
named plan.xml, if one is available in the \plan subdirectory. The Administration Console does not identify plans in subdirectories other than the
\plan subdirectory; in other words, plans in \plan1 or \plan2 subdirectories are not identified by the Administration Console. Therefore, if multiple plans for
your application are available, you must indicate, in config.xml, the plan you would like to use. See
Chapter 4, Configuring Applications for Production Deployment
. For information on config.xml, see Creating Domains Using the Configuration Wizard.
After installing the application, you can configure, deploy, or distribute the application as necessary.
3.6 Using FastSwap Deployment to Minimize Redeployment