6 WebLogic Server Virtual Hosts

This chapter describes how to monitor and configure virtual hosts. A virtual host is a set of host names to which WebLogic Server instances (servers) or clusters respond.

When you use virtual hosting, you use the domain name system (DNS) to specify one or more host names that map to the IP address of a server or cluster. You also specify which Web applications are served by each virtual host. For more information on virtual hosting, see Configuring Virtual Hosting in Configuring Server Environments for Oracle WebLogic Server.

Note:

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

This chapter includes the following section:

Monitor virtual hosts

To monitor the status of a virtual host:

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

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

    • Name

    • Virtual Host Names

    • Network Access Point

    • Frontend Host

    • Frontend HTTP Port

    • Frontend HTTPS Port

    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

    • Detach: detach the table (viewing option)

    • Sort: sort the columns in ascending or descending order

    • Reorder: change the order of the columns displayed

    • Query by Example

  2. In the table, select the name of the virtual host for which you want to view configuration information.

Create virtual hosts

To create a virtual host:

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

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

  2. Click Create.

    The Create a Virtual Host dialog appears.

  3. Enter a name for your new virtual host and click Create.

The virtual host you created appears in the Virtual Hosts table.

Configure virtual hosts

To configure a virtual host:

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

    The Virtual Hosts table displays the virtual hosts that are created in the current domain. If the table is empty, refer to Create virtual hosts.

  2. Select the virtual host you want to configure.
  3. Click Configuration.
  4. Define the configuration for your virtual host on each of the following pages:
    For more information about these fields, see Configuration Options.

General

On the General page, define the general configuration settings for your new virtual host:

  1. Virtual Host Names - Host names, separated by line breaks, for which this virtual host will serve requests.

  2. Network Access Point Name - Dedicated server channel name (NetworkAccessPoint) for which this virtual host serves HTTP requests.

  3. Click Apply.

For more information on general destination attributes, see General

Logging

On the Logging page, click the Log Configuration link to configure the log configuration settings for your new virtual host:

  1. Select HTTP access log file enabled to activate HTTP logging (or deselect the check box to deactivate HTTP logging).

    HTTP requests for a virtual host are kept in a log file that is separate from the server's log files.

  2. In Log file name, enter the name of the log file.

    To include a time or date stamp in the file name when the log file is rotated, in the Log file name field, add java.text.SimpleDateFormat variables to the file name. Surround each variable with percentage (%) characters.

    For example, if you enter the following value in the Log file name field: access_%yyyy%_%MM%_%dd%_%hh%_%mm%.log the virtual host's HTTP log file will be named: access_yyyy_MM_dd_hh_mm.log.

    When the server instance rotates the HTTP log file, the rotated file name contains the date stamp.

    For example, if the server instance rotates the log file on 2 April, 2003 at 10:05 AM, the log file that contains the old log messages will be named: access_2003_04_02_10_05.log.

    If you do not include a time and date stamp, the rotated log files are numbered in order of creation filenamennnnn, where filename is the name configured for the log file.

    For example: access.log00007.

  3. If you want the server to move old HTTP requests to another file when the current HTTP log file reaches a specific size, do the following:

    1. In Rotation type, choose By Size.

    2. In Rotation file size, specify the file size (1 - 65535 kilobytes) that triggers the server to move log messages to a separate file. After the log file reaches the specified size, the next time the server checks the file size, it will rename the current log file and create a new one to store subsequent messages.
  4. If you want the server to move old HTTP requests to another file at specific time intervals, do the following:

    1. In Rotation type, choose By Time.

    2. In Begin rotation time, enter the start time.

      At the time that you specify, the server rotates the current log file. If the time that you specify has already past, then the server starts its file rotation immediately. Thereafter, the server rotates the log file at an interval that you specify in Rotation interval. Use the following java.text.SimpleDateFormat format to specify a date and time: MM-DD-yyyy-k:mm:ss.

  5. If you want to limit the number of retained files, select the Limit number of retained files checkbox.

  6. To indicate the maximum number of files to retain, enter the number in the Files to retain checkbox.

  7. Determine the log file rotation directory by entering that directory in the Log file rotation directory field.

  8. If you want to rotate the log file on startup, select the Rotate log file on startup check box.

  9. To change the format of the HTTP log file, in the Advanced options, do the following:

    1. Determine the format of the HTTP log file by selecting Common or Extended from the Format list.

    2. Set up HTTP access logs in the Extended Logging Format Fields.

      For information on how to set up the logs, see Setting Up HTTP Access Logs by Using Extended Log Format

    3. Enter the Log File Buffer.

    4. To log time in Greenwich Mean Time, select the Log time in GMT check box.
  10. Click Apply.

For more information about these fields, see Logging.

HTTP

On the HTTP page, define the HTTP configuration settings for your new virtual host:

  1. Post Timeout - Amount of time the server instance waits between receiving HTTP POST data before timing out.

  2. Max Post Time - Maximum time allowed for reading HTTP Post data in a servlet request.

  3. Max Post Size - Maximum post size allowed when reading HTTP Post data in a servlet request.

  4. Enables Keepalives - Indicates if there is a persistent connection to the server.

  5. Duration - Amount of time the server waits before closing an inactive HTTP connection.

  6. HTTPS Duration - Amount of time the server waits before closing an inactive HTTPS connection.

  7. Accept Context Path in Get Real Path - Indicates if the server instance allows inclusion of the context path in the virtual path.

  8. Click Apply.

For more information on HTTP attributes, see HTTP

Target virtual hosts to servers

You can choose the server, multiple servers, or a cluster in your domain on which to deploy a virtual host. You can also reconfigure the deployment targets later if you wish.

To target a virtual host:

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

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

  2. Select the virtual host that you want to target.
  3. Click Targets.
    A table of servers and /or clusters to which you can target your virtual host appears.
  4. You can select one or more servers and clusters where the virtual host will be deployed.
  5. Click Save.

For more information about these fields, see Targets.

Add notes

Use this page to include any additional information that describes the configuration of this virtual host.

To create notes for this virtual host,
  1. From the WebLogic Domain menu, select Environment, then select Virtual Hosts.
    The Virtual Hosts table displays information about each virtual host that has been configured in the current domain.
  2. From the table, select the name of the virtual host to which you want to add the notes.
  3. Click Notes.
  4. On the Notes page, enter any notes about the configuration of this virtual host.
  5. Click Save.

For more information about the fields on this page, see Configuration Options

Delete virtual hosts

To delete a virtual host:

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

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

  2. Select the virtual host that you want to delete.
  3. Click Delete.

    A confirmation message is displayed on the page.

  4. Click Ok.

    A confirmation message is displayed on the Virtual Hosts page indicating the selected virtual host is deleted.