Before You Begin
This tutorial shows you how to create and configure a domain template for Oracle WebLogic Server 12c.
Background
By creating and using a customized domain template, you can create domains for multiple development, test, and production environments. Templates are created by using the Domain Template Builder.
This tutorial covers creating and configuring an Oracle WebLogic Server 12c domain template by using the Domain Template Builder tool. It then shows how to use that template to create a new WebLogic Server domain.
Oracle recommends that you locate your domain home in accordance with the directory structure summarized in What are the Key Oracle Fusion Middleware Directories? in Understanding Oracle Fusion Middleware, where the domain home is located outside the Oracle home directory. This directory structure helps you avoid issues when you upgrade or reinstall your software.
What Do You Need?
- An installation of Oracle WebLogic Server 12c. See http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html.
- This tutorial uses an instance of WebLogic Server installed in
/u01/app/fmw
. - You should have completed the Oracle by Example tutorials titled WebLogic Server 12c: Installing WebLogic Server Using the Generic Installer and WebLogic Server 12c: Creating and Starting a Basic Domain. This tutorial assumes that Oracle WebLogic Server 12c has been installed successfully.
Creating a Template
To create an Oracle WebLogic Server 12c domain template by using the Domain Template Builder, perform the following steps:
- Open a terminal window and navigate to the bin directory.
$ cd $ORACLE_HOME/oracle_common/common/bin
ORACLE_HOME
is the path where the WebLogic Server server is installed. In this tutorial, the path is:/u01/app/fmw/oracle_common/common/bin
.Enter the following command to run the Domain Template Builder tool:
$ ./config_builder.sh
The Domain Template Builder Configuration Wizard appears. - In the Template Type screen, select the following:
- Create Domain Template
- Use Domain as a Source
- Specify the source for the domain template:
/u01/app/fmw/wlserver/samples/domains/medrec - Specify the destination JAR file for the domain template:
/u01/app/fmw/user_projects/user_templates/mymedrectemplate.jar
Click Next.
- In the Template Information screen, enter MyMedrecTemplate in the Name field.
Leave the rest of the fields at their defaults. Then, click Next. - In the Applications screen, review the list of applications included in the domain. Deselect any applications that you do not want to include in the destination domain.
Click Next to continue.
Note: This screen appears only if applications are included in the domain or template source that you selected.
- In the Domain Content screen, review the files that are included in the template.
If necessary, add or remove files to the template.
Click Next to continue.
- In the Scripts and Files screen, perform the following steps:
- From the Select File list, open a file to which you want to add a replacement variable.
- Select a string that you want to replace with a variable.
- Right-click to display the Replacement Variable pop-up list.
- In the Select File list, select the check box for the file to indicate that it has been changed.
- Click Next to continue.
- In the Template Summary screen, review the configuration details and then click Create to continue.
- In the Configuration Progress screen, after the progress bar reaches 100%, click Next.
- On the End of Configuration screen, click Finish.
- In a terminal window, navigate to the location of the template JAR file to ensure that it has been created.
In this tutorial, the directory is.
/u01/app/fmw/user_projects/user_templates/
Output:
bash-4.1$ cd /u01/app/fmw/user_projects/user_templates/ bash-4.1$ ls mymedrectemplate. jar bash-4.1$
Creating a WebLogic Domain from the Template
To create a WebLogic Server domain from the domain template that you just created, perform the following steps:
- Open a terminal window and navigate to the bin directory.
$ cd $ORACLE_HOME/oracle_common/common/bin
ORACLE_HOME
is the path where the WebLogic Server server is installed. In this tutorial, the path is:/u01/app/fmw/oracle_common/common/bin
.Then enter the following command to run the Configuration Wizard:
$ ./config.sh
The Configuration Wizard appears.
- In the Configuration Type screen, select Create a new domain.
Specify the domain name and location in the Domain Location field.
In this tutorial, the following name and location have been specified:- Name:
mydomain
- Location:
/u01/app/fmw/user_projects/domains/
Click Next to continue.
- Name:
- In the Templates screen, select Create Domain Using Custom Template. Then click the Browse button to select the template created earlier.
In this tutorial, it is here:/u01/app/fmw/user_projects/user_templates
Click Next to continue.
- In the Administrator Account screen, enter a name in the Name field, enter a password in the Password field, and enter the password again in the Confirm Password field.
Then click Next.
Important: Do not forget this user name and password. These are required to perform actions on the domain, from starting servers to changing the domain configuration.
- In the Domain Mode and JDK screen, under Domain Mode, select the Production Mode option.
Select Oracle HotSpot 1.8.0_211 under JDK.
In this tutorial, it is the only JDK listed and it is already selected. You may have more than one JDK.
Then click Next.
Tip: For details about options on this screen, including differences between development mode and production mode, see Domain Mode and JDK in Creating WebLogic Domains Using the Configuration Wizard.
- In the JDBC Data Sources screen, keep all the defaults and click Next.
- In the JDBC Data Sources Test screen, ignore the error and click Next.
Note: The database is not running, so when the Configuration Wizard tried connecting to it, it failed.
- In the Warning dialog box, click OK.
- In the Advanced Configuration screen, select Administration Server, Node Manager, and Managed Servers, Clusters and Coherence.
Then click Next. - In the Administration Server screen, enter/update the following values:
- Server Name:
MedRecAdminServer
- Listen Address: Select the drop-down list next to Listen Address and select the IP address on the host
where the Administration Server will reside. Do not use All Local Addresses. - Listen Port
8011
- Enable SSL
Checked
- SSL Listen Port
8012
Click Next to continue.
- Server Name:
- Use the Node Manager screen to select the type of Node Manager you want to configure, along with the Node Manager credentials.
Select Per-Domain Default Location as the Node Manager type, then specify Node Manager credentials (if required).
Click Next. - In the Managed Servers screen, click Add.
- When a row appears in the table, enter
medrec1
in the Managed Server Name field.
In the Listen Address drop-down list, select/enter the IP address/hostname of the host that the Managed Server will reside on. Do not use All Local Addresses.
Change the Listen port to8013
.
Leave the SSL enabled option deselected.Description of the illustration managed_server_1.jpg Tip: For more about options on this screen, see Managed Servers in Creating WebLogic Domains Using the Configuration Wizard.
- Repeat the process mentioned in step 13 to create a second Managed Server named
medrec2
.
Enter8015
for Listen Port.Configuring a second Managed Server is one of the steps needed to configure the standard topology for high availability. If you are not creating a highly available environment, then this step is optional.
Click Next.
Description of the illustration managed_server_2.jpg - For more details on the high availability standard topology, see About the Oracle Fusion Middleware Standard HA Topology in the High Availability Guide.
- For more details on the next steps to prepare for high availability after your domain is configured, see Preparing Your Environment For High Availability.
- In the Clusters screen, click Next.
- In the Machines screen, click Next.
- The Configuration Summary screen has detailed configuration information for the domain you are about to create. Review this screen to verify that the information is correct.
To make any changes, go back to a screen by using the Back button or selecting the screen in the navigation pane.
Domain creation does not start until you click Create.
Click Create.
- In the Configuration Progress screen, after the progress bar reaches 100%, click Next.
- The End Of Configuration screen dispays the following items about the domain you just configured.
- Domain Location
- Admin Server URL
You must make a note of both items. You will need them to start the servers and access the Administration Server.
Click Finish.Description of the illustration configuration_wizard_complete.jpg A WebLogic Server domain based on the domain template has now been created.
- To view the directory structure and files for the newly created domain, enter the following commands in a terminal window.
$ cd /u01/app/fmw/user_projects/domains/mydomain $ ls
Note: If you placed the domain in a different location, cd to that directory.
Want to Learn More?
- For documentation on Oracle WebLogic Server 12c, visit the Oracle WebLogic Server Documentation Library.
- For information on Creating and Configuring Weblogic Domain, see Creating and Configuring the WebLogic Domain.
- For information on Domain home directory, see About the Domain Home Directory in Planning an Installation of Oracle Fusion Middleware.
- For information on reinstalling the software, see Reinstalling Your Software.
- To learn more about Oracle WebLogic Server, refer to additional OBEs in the Oracle Learning Library.