8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » 11g » Here

WebLogic Server 11g and 12cR1 (12.1.1) : Create, Extend and Remove Domains

This article provides a quick overview of managing domains in WebLogic Server 11g and 12cR1 (12.1.1). The examples all relate to WebLogic 11g installations, but the process is exactly the same on WebLogic 12cR1 (12.1.1).

Related articles.

Create a Domain

Start the Configuration Wizard.

$ $WLS_HOME/common/bin/config.sh

Accept the "Create a new WebLogic domain" option by click the the "Next" button.

Welcome

Select the products the domain requires and click the "Next" button.

Select Domain Source

Enter the domain name and the locations of the domain and application directories, the click the "Next" button.

Specify Domain Name and Location

Enter an administrator username and password, then click the "Next" button.

Configure Administrator User Name and Password

Select the server start mode and JDK, then click the "Next" button. For production mode you should use the JRockit JDK.

Configure Server Start Mode and JDK

Select any optional configuration (like resetting ports) if required, or click the "Next" button to ignore this step.

Select Optional Configuration

If you are happy with the information in the configuration summary, click the "Create" button.

Configuration Summary

Wait while the domain is created, then click the "Done" button to exit the Configuration Wizard.

Creating Domain

The following scripts are created for the "testDomain" domain.

$ # Start NodeManager
$ nohup $WLS_HOME/server/bin/startNodeManager.sh > /dev/null 2>&1 &


$ # Start WebLogic
$ nohup $MW_HOME/user_projects/domains/testDomain/startWebLogic.sh > /dev/null 2>&1 &
$ # or
$ nohup $MW_HOME/user_projects/domains/testDomain/bin/startWebLogic.sh > /dev/null 2>&1 &

$ # Stop WebLogic
$ $MW_HOME/user_projects/domains/testDomain/bin/stopWebLogic.sh


$ # Start Managed Server
$ nohup $MW_HOME/user_projects/domains/testDomain/bin/startManagedWebLogic.sh AdminServer > /dev/null 2>&1 &

$ # Stop Managed Server
$ $MW_HOME/user_projects/domains/testDomain/bin/stopManagedWebLogic.sh AdminServer

Once the domain is started, the administration console is available in a browser using a URL such as "http://machine:7001/console".

Extend a Domain

Extending a domain involves similar screens to those seen during the installation.

Delete a Domain

To remove the "testDomain" domain we just created, do the following steps:

Creating a Boot Identity File

When running in production mode, starting a server requires the credentials you provided while creating the domain. Using a boot identity file prevents you from having to type in the username/password each time the server is started.

Create a file called "boot.properties" with the following contents.

username=weblogic
password=mypassword

Save the file under the "$MW_HOME/user_projects/domains/<domain-name>/servers/<server-name>/security" directory. The managed server will now start and stop without needing credentials.

Alternatively, modify the JAVA_OPTIONS in the "setDomainEnv.sh" file to point to the location of the file. For example, if the "boot.properties" file is in the domain's home directory, you could place the following lines after the DOMAIN_HOME defintion. This method works fine for startup, but shutdown will still require credentials, so it is not as convenient.

JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.system.BootIdentityFile=${DOMAIN_HOME}/boot.properties"
export JAVA_OPTIONS

The first time the server starts using a boot identity file, it will encrypt the credentials in the file and use them when starting in future.

Altering Server Port Settings

When you create a domain you will automatically create an AdminServer that listens on port 7001 by default. To change this, edit the "$MW_HOME/user_projects/domains/<domain-name>/config/config.xml" file, adding or amending the "listen-port" entry, shown in bold.

  <server>
    <name>AdminServer</name>
    <listen-port>7004</listen-port>
    <listen-address/>
    <server-diagnostic-config>
      <name>AdminServer</name>
      <diagnostic-context-enabled>true</diagnostic-context-enabled>
    </server-diagnostic-config>
  </server>

Switching Development/Production Startup Mode

There are two locations where the startup mode can be set. If you are using the Java based controls the mode is picked up from the "$MW_HOME/user_projects/domains/domain-name/config/config.xml" file. Set the "production-mode-enabled" tag to the appropriate value.

<production-mode-enabled>true</production-mode-enabled>

If you are starting the domain using the generated startup scripts, you should edit the "$MW_HOME/user_projects/domains/domain-name/bin/setDomainEnv.sh" file. Set the "PRODUCTION_MODE" parameter to the appropriate value.

PRODUCTION_MODE="true"
export PRODUCTION_MODE

To prevent confusion, it makes sense to keep both files set to the same value.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.