26 WebLogic Server Virtual Targets

This chapter describes the tasks you can perform to create and monitor virtual targets. Virtual targets encapsulate where a partition or resource group runs and how to route traffic to them, including addresses, protocol settings, and targeting.

Virtual targets isolate a domain partition and the global (domain-level) runtime from the physical attributes of the target WebLogic Server instances so that your application does not have to know these details.

For more information on WebLogic Server virtual targets, see "Configuring Virtual Targets" in Using WebLogic Server MT.

Note:

If you are logged into a domain partition, navigate from the Domain Partition menu.

This chapter includes the following sections:

Create virtual targets

To create a new virtual target:

  1. From the WebLogic Domain menu, select Environment, then select Virtual Targets.

    The Virtual Targets table displays information about each virtual target that has been configured in the current domain.

  2. Click Create.

  3. On the Create Virtual Target page, define the configuration settings for your new virtual target:

    • Name: enter a name for the new virtual target

    • URI Prefix: optional URI prefix for which this virtual target will serve requests. For example, if you enter www.example.com as the host name and MyApp as the URI prefix, this virtual target serves requests to www.example.com/MyApp, but not to www.example.com or www.example.com/foo.

  4. Click Add. Enter the list of host names for which this virtual target will serve requests. The host names you specify must have DNS entries that resolve to the correct servers, or to a load balancer:

    • If you are not using Oracle Traffic Director (OTD) to load balance connections for a partition, then specify the actual host name of the WebLogic Server cluster or managed server.

    • If you are using OTD to load balance connections for a partition, then you access applications through OTD. The host names you specify for a virtual target must resolve to the location of the OTD Administration Server.

    If you do not specify a host name, then it is the equivalent of specifying a wildcard for the host name to match all incoming requests.

    The host name used by a client to access the resource group must exactly match one of the host names specified in the virtual target. Because you can specify multiple host names for the virtual target, you might find it convenient to specify both the simple and the fully qualified host name to ensure a match.

  5. In the Advanced Options section, optionally specify an existing channel and port (explicit or offset) information to use as a reference for a partition-specific channel for this virtual target.

    As described in "Understanding Network Channels" in Administering Server Environments for Oracle WebLogic Server, a network channel is a configurable resource that defines the attributes of a network connection to WebLogic Server. A network channel in a WebLogic Server instance is a combination of the following four attributes: communication protocol, listen address, listen port, and channel name.

    The channel must exist on the selected target and be configured using the same protocol. If you specify a value for Partition Channel, then you must specify either an explicit port or a port offset.

    Consider the following example:

    1. Create a virtual target with the host name myexample.com and the URI prefix /foo.

    2. In the Partition Channel field, specify the existing channel Channel-1 to use as a reference for creating a partition-specific channel.

    3. Channel-1 has a listen address and listen port of 127.0.0.1:7002 and an external address and listen port of 127.0.0.1:7002.

    4. Specify a port offset of 5. That results in 7002 +5 for the listen port.

    5. myexample.com must resolve to 127.0.0.1.

    6. To access this virtual target, use myexample.com:7007/foo.

    7. If you create another virtual target that also uses Channel-1, then you must use another port offset (or explicit port) or there will be a port conflict.

    8. In all cases, specify either an explicit port value to use as-is, or an offset. Otherwise, there is no port assigned and the channel is not created and used.

    You use the WebLogic Server Administration Console to create a channel. See "Configure custom network channels" in the WebLogic Server Administration Console online help.

    Note:

    These advanced options are ignored if you use OTD to load balance the domain partition.

  6. Click Next.

  7. Choose whether to target the virtual target to a server or cluster.

    Use the menu to select whether to target this virtual target to an existing server or an existing cluster.

  8. Optionally, enter a location for the virtual target log file. By default, the virtual target log file is written to domain-name/servers/server-name/logs/virtualTargets/virtual-target-name/access.log when the virtual target is first accessed.

  9. Enter any notes you want to describe this virtual target.

  10. Click Create.

If two virtual targets have the same host names, URI prefix, and port number, then they must be targeted to different clusters or managed servers.

Note:

Do not configure a virtual target as host name: "", URI prefix: /, explicit port: 0, port offset: 0. This configuration makes the virtual target intercept all requests intended for default HTTP server. This configuration is not allowed.

For more information about these fields, see Configuration Options.

Delete virtual targets in use by a partition

You cannot delete a virtual target that is in use by a resource group or partition. You must first remove it from the resource group or partition.

To delete a virtual target that is in use by a partition:

  1. From the WebLogic Domain menu, select Environment, then select Domain Partitions.

    The Domain Partitions table displays information about each partition that has been configured in the current domain.

  2. Click next to the partition from which you want to remove the virtual target.
  3. From the Control menu, select Stop to stop the partition.
  4. Select the partition.
  5. From the Domain Partition menu, select Administration and then Resource Groups.
  6. Select the resource group that references the virtual target you want to delete.
  7. Select the Targets page.
  8. Deselect the virtual target you want to delete.
  9. From the Domain Partition menu, select Administration and then Available Targets.
  10. If Use as Default is set for the virtual target you want to delete, then deselect this control.
  11. Deselect the virtual target that you want to delete.
  12. Click Save.
  13. From the Domain Partition menu, select Control and then Start Up.
  14. From the WebLogic Domain menu, select Environment, then select Virtual Targets.

    The Virtual Targets table displays information about each virtual target that has been configured in the current domain.

  15. Click next to the virtual target you want to delete. If this virtual target is not referenced by a domain partition or resource group, then the Delete control becomes active.
  16. Click Delete.

For more information about these fields, see Configuration Options.

Delete virtual targets in use by a resource group at domain level

You cannot delete a virtual target that is in use by a resource group or partition. You must first remove it from the resource group or partition.

To delete a virtual target that is in use by a resource group at the domain level:

  1. From the WebLogic Domain menu, select Environment, then select Resource Groups.

    The Resource Groups table displays information about each resource group that has been configured in the current domain.

  2. Select the resource group that references the virtual target you want to delete.
  3. Select the Targets page.
  4. Deselect the virtual target you want to delete.
  5. Click Save.
  6. From the WebLogic Domain menu, select Environment, then select Virtual Targets.

    The Virtual Targets table displays information about each virtual target that has been configured in the current domain.

  7. Click next to the virtual target you want to delete. If this virtual target is not referenced by a resource group, then the Delete control becomes active.
  8. Click Delete.

For more information about these fields, see Configuration Options.

Monitor virtual targets

To monitor all virtual targets configured in a domain:

  1. From the WebLogic Domain menu, select Environment, then select Virtual Targets.

    The Virtual Targets table displays information about each virtual target that has been configured in the current domain, including:

    • Name

    • Host Names

    • Uri Prefix

    • Targets

    • Explicit Port

    • Port Offset

    • Partition Channel

    • Used By

    • Log File Name

    For more information about these fields, see Configuration Options.

    Optionally, select View to access the following table options:

    • Columns: add or remove the columns displayed in the table

    • Sort: sort the columns in ascending or descending order

    • Reorder: change the order of the columns displayed

Configure virtual targets

This section describes how to configure virtual targets.

This section includes the following tasks:

Configure general virtual target settings

To configure general settings for a virtual target:

  1. If this virtual target is in use by a domain partition, then you must first stop the partition.

    1. From the WebLogic Domain menu, select Environment, then select Domain Partitions.

      The Domain Partitions table displays information about each partition that has been configured in the current domain.

    2. Click next to the partition for which you want to configure the virtual target.

    3. From the Control menu, select Stop to stop the partition.

  2. From the WebLogic Domain menu, select Environment, then select Virtual Targets.

    The Virtual Targets table displays information about each virtual target that has been configured in the current domain.

  3. In the Virtual Targets table, select the virtual target you want to configure.

  4. Select General.

    From the General page, you can view and define general configuration settings for a virtual target:

    • Name

    • Uri Prefix

    • Host Name

    You can add a new host name by clicking Add in the Host Name field and entering the host name.

    For more information about these fields, see Configuration Options.

  5. In the Advanced Options section, optionally specify an existing channel and port (explicit or offset) information to use as a reference for a partition-specific channel for this virtual target.

    As described in "Understanding Network Channels" in Administering Server Environments for Oracle WebLogic Server, a network channel is a configurable resource that defines the attributes of a network connection to WebLogic Server. A network channel in a WebLogic Server instance is a combination of the following four attributes: communication protocol, listen address, listen port, and channel name.

    The channel must exist on the selected target and be configured using the same protocol. If you specify a value for Partition Channel, then you must specify either an explicit port or a port offset.

    Consider the following example:

    1. Create a virtual target with the host name myexample.com and the URI prefix /foo.

    2. In the Partition Channel field, specify the existing channel Channel-1 to use as a reference for creating a partition-specific channel.

    3. Channel-1 has a listen address and listen port of 127.0.0.1:7002 and an external address and listen port of 127.0.0.1:7002.

    4. Specify a port offset of 5. That results in 7002 +5 for the listen port.

    5. myexample.com must resolve to 127.0.0.1.

    6. To access this virtual target, use myexample.com:7007/foo.

    7. If you create another virtual target that also uses Channel-1, then you must use another port offset (or explicit port) or there will be a port conflict.

    8. In all cases, specify either an explicit port value to use as-is, or an offset. Otherwise, there is no port assigned and the channel is not created and used.

    You use the WebLogic Server Administration Console to create a channel. See "Configure custom network channels" in the WebLogic Server Administration Console online help.

    Note:

    These advanced options are ignored if you use OTD to load balance the domain partition.

  6. Click Save.

  7. If this virtual target is in use by a domain partition, then you must start the partition.

    1. From the WebLogic Domain menu, select Environment, then select Domain Partitions.

      The Domain Partitions table displays information about each partition that has been configured in the current domain.

    2. Click next to the partition for which you configured the virtual target.

    3. From the Control menu, select Start to start the partition.

Target a virtual target

To select the targets for a virtual target:

  1. If this virtual target is in use by a domain partition, then you must first stop the partition.

    1. From the WebLogic Domain menu, select Environment, then select Domain Partitions.

      The Domain Partitions table displays information about each partition that has been configured in the current domain.

    2. Click next to the partition for which you want to configure the virtual target.

    3. From the Control menu, select Stop to stop the partition.

  2. From the WebLogic Domain menu, select Environment, then select Virtual Targets.

    The Virtual Targets table displays information about each virtual target that has been configured in the current domain.

  3. In the Virtual Targets table, select the virtual target you want to configure.

  4. Select Targets.

  5. Choose whether to target the virtual target to a server or cluster.

    Use the menu to select whether to target this virtual target to an existing server or an existing cluster.

    For more information, see Configuration Options.

  6. Click Save.

  7. If this virtual target is in use by a domain partition, then you must restart the partition.

    1. From the WebLogic Domain menu, select Environment, then select Domain Partitions.

      The Domain Partitions table displays information about each partition that has been configured in the current domain.

    2. Click next to the partition for which you configured the virtual target.

    3. From the Control menu, select Start to start the partition.

Create virtual target notes

To create notes for a virtual target:

  1. From the WebLogic Domain menu, select Environment, then select Virtual Targets.

    The Virtual Targets table displays information about each virtual target that has been configured in the current domain.

  2. In the Virtual Targets table, select the virtual target you want to configure.
  3. Select Notes.

    On the Notes page, enter your notes.

    For more information, see Configuration Options.

  4. Click Save.