Oracle by Example brandingCreate and Use a Domain Template

section 0Before 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?


section 1Creating a Template

To create an Oracle WebLogic Server 12c domain template by using the Domain Template Builder, perform the following steps:

  1. 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.
  2. 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.

  3. In the Template Information screen, enter MyMedrecTemplate in the Name field.
    Leave the rest of the fields at their defaults. Then, click Next.
  4. 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.

  5. 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.

    Description of domain_content.jpg follows
    Description of the illustration domain_content.jpg

  6. In the Scripts and Files screen, perform the following steps:
    1. From the Select File list, open a file to which you want to add a replacement variable.
    2. Select a string that you want to replace with a variable.
    3. Right-click to display the Replacement Variable pop-up list.
    4. In the Select File list, select the check box for the file to indicate that it has been changed.
    5. Click Next to continue.

    Description of scripts_files follows
    Description of the illustration scripts_files.jpg

  7. In the Template Summary screen, review the configuration details and then click Create to continue.
  8. In the Configuration Progress screen, after the progress bar reaches 100%, click Next.
  9. On the End of Configuration screen, click Finish.

    Description of configuration_complete.jpg follows
    Description of the illustration configuration_complete.jpg

  10. 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$                     


section 2Creating a WebLogic Domain from the Template

To create a WebLogic Server domain from the domain template that you just created, perform the following steps:

  1. 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.

  2. 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.

  3. 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.

  4. 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.
  5. 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.

  6. In the JDBC Data Sources screen, keep all the defaults and click Next.
  7. 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.

    Description of JDBC_data_sources_test.jpg follows
    Description of the illustration JDBC_data_sources_test.jpg

  8. In the Warning dialog box, click OK.
  9. In the Advanced Configuration screen, select Administration Server, Node Manager, and Managed Servers, Clusters and Coherence.
    Then click Next.
  10. 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.

    Description of administration_server.jpg follows
    Description of the illustration administration_server.jpg

  11. 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.
  12. In the Managed Servers screen, click Add.
  13. 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 to 8013.
    Leave the SSL enabled option deselected.

    Description of managed_server_1.jpg follows
    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.

  14. Repeat the process mentioned in step 13 to create a second Managed Server named medrec2.
    Enter 8015 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 managed_server_2.jpg follows
    Description of the illustration managed_server_2.jpg

  15. In the Clusters screen, click Next.
  16. In the Machines screen, click Next.
  17. 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.
  18. In the Configuration Progress screen, after the progress bar reaches 100%, click Next.
  19. 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 configuration_wizard_complete.jpg follows
    Description of the illustration configuration_wizard_complete.jpg

    A WebLogic Server domain based on the domain template has now been created.

  20. 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.


more informationWant to Learn More?