8 Managing Connectivity

You can manage and monitor the performance of Oracle HTTP Server connectivity by creating ports, viewing port number usage, and configuring virtual hosts.

This chapter includes the following sections which describes the procedures for managing Oracle HTTP Server connectivity:

Default Listen Ports

Listen ports (SSL and non-SSL) have a default range of port numbers.

Automatic port assignment occurs only if you use ohs_createInstance() or Fusion Middleware Control. The default, non-SSL port is 7777. If port 7777 is occupied, the next available port number, within a range of 7777-65535, is assigned. The default SSL port is 4443. Similarly, if port 4443 is occupied, the next available port number, within a range of 4443-65535, is assigned.

If you create instances using Configuration Wizard, then you must perform your own port management. The Configuration Wizard has no automatic port assignment capabilities.

For information about specifying ports when creating a new Oracle HTTP Server component, see Creating an Oracle HTTP Server Instance.

Defining the Admin Port

Admin port is used internally by Oracle HTTP Server to communicate with Node Manager. This port is configured in the admin.conf file.

The communication between Node Manager and admin port happens over SSL, by default. It is possible to use plain-text communication by disabling SSL on the admin port, however it's not recommended. If SSL is disabled, a warning message indicating plain-text communication is logged to the console and the ohs_nm.log during Oracle HTTP Server start-up, and then the OHS starts successfully. The following is the sample warning message:

“SSL is not enabled for the admin port of 'ohs1'. Thus,
the connection between NodeManager and the admin port of 'ohs1' is not
secure. SSL must be enabled for this connection. For more
information on how to enable SSL for this connection, refer to OHS
documentation”.

See Configuring SSL for Admin Port.

Automatic Admin port assignment occurs only if you use ohs_createInstance() or Fusion Middleware Control. If you create instances using Configuration Wizard, then you must perform your own Admin port management. The Configuration Wizard has no automatic port assignment capabilities.

If for any reason you need to use the default port for another purpose, you can reconfigure the Admin port by using the Configuration Wizard to update the domain and manually reset ports there.

Viewing Port Number Usage

You can view ports using Fusion Middleware Control or WLST.

This section includes the following topics:

Viewing Port Number Usage by Using Fusion Middleware Control

You can view how ports are assigned on the Fusion Middleware Control Port Usage detail page. To view the port number usage using Fusion Middleware Control, do the following:

  1. Navigate to the Oracle HTTP Server home page.
  2. Select Port Usage from the Oracle HTTP Server menu.

    The Port Usage detail page shows the component, the ports that are in use, the IP address the ports are bound to, and the protocol being used.

Viewing Port Number Usage Using WLST

If you are using Oracle HTTP Server in collocated mode, then you can use WLST commands to view the port number information on a given instance.

  1. Launch WLST:
    $ORACLE_HOME/oracle_common/common/bin/wlst.sh
    
  2. Connect to the AdminServer.
  3. Use the editCustom() command to navigate to the root of the oracle.ohs MBean. You can use the editCustom() command only when WLST is connected to the Administration Server. Use cd to navigate the hierarchy of management objects, then get() to get the value of the Ports parameter:
    editCustom()
    cd('oracle.ohs')
    cd('oracle.ohs:type=OHSInstance,name=ohs1')
    get('Ports')

WLST will return a value similar to the following:

array(java.lang.String,['7777', '4443', '127.0.0.1:9999']) 

Note:

On Unix, you can also cd into the directory of the master copy of the Oracle HTTP Server configuration files and do a grep for the Listen directives.

Managing Ports

The ports used by Oracle HTTP Server can be set during and after installation. In addition, you can change the port numbers, as needed.

This section describes how to create, edit, and delete ports using Fusion Middleware Control.

Caution:

The Oracle HTTP Server administration virtual host and its configuration, defined in the admin.conf file, must not be edited with the WebLogic Scripting Tool (WLST).

See Also:

Changing the Oracle HTTP Server Listen Ports in the Administering Oracle Fusion Middleware.

This section includes the following topics:

Note:

When deleting a port, if there is a virtual host configured to use the port you want to delete, you must first delete that virtual host before deleting the port.

Creating Ports Using Fusion Middleware Control

You create a port for an Oracle HTTP Server endpoint on the Fusion Middleware Control Create port page. To create ports using Fusion Middleware Control, do the following:

  1. Navigate to the Oracle HTTP Server home page.
  2. Select Administration from the Oracle HTTP Server menu.
  3. Select Ports Configuration from the Administration menu.
  4. Click Create.
  5. Use the IP Address menu to select an IP address for the new port. Ports can listen on a local IP Address of an associated host or on any available network interfaces.

    You can configure SSL for a port on the Virtual Hosts page, as described in Configuring Virtual Hosts Using Fusion Middleware Control.

  6. In Port, enter the port number.
  7. Click OK.
  8. Restart Oracle HTTP Server. See Restarting Oracle HTTP Server Instances.

Note:

If you change the port or make other changes that affect the URL, such as changing the host name, enabling or disabling SSL, you need to re-register partner applications with the SSO server using the new URL. See Registering Oracle HTTP Server mod_osso with OSSO Server.

Editing Ports Using Fusion Middleware Control

You can edit the values for existing ports on the Fusion Middleware Control Edit Port page. To edit the ports using Fusion Middleware Control, do the following:

  1. Navigate to the Oracle HTTP Server home page.
  2. Select Administration from the Oracle HTTP Server menu.
  3. Select Ports Configuration from the Administration menu.
  4. Select the port for which you want to change the port number.

    The Admin port cannot be edited by using Fusion Middleware Control. Although this is a port Oracle HTTP Server uses for its internal communication with Node Manager, in most of the cases it does not need to be changed. If you really want to change it, manually edit the DOMAIN_HOME/config/fmwconfig/components/OHS/componentName/admin.conf file.

  5. Click Edit.
  6. Edit the IP Address and/or Port number for the port.

    You can be configure SSL for a port on the Virtual Hosts page as described in Configuring Virtual Hosts Using Fusion Middleware Control.

  7. Click OK.
  8. Restart Oracle HTTP Server. See Restarting Oracle HTTP Server Instances.

Note:

If you change the port or make other changes that affect the URL, such as changing the host name, enabling or disabling SSL, you need to re-register partner applications with the SSO server using the new URL.

Disabling a Listening Port in a Standalone Environment

While you can use Fusion Middleware Control to disable a listen port in a WebLogic Server environment, to do so in a standalone environment, you must directly update staging configuration file by commenting-out the line where port is exposed; for example:

#Listen slc01qtd.us.myCo.com:7777

Note:

Before attempting to edit any .conf file, you should familiarize yourself with the layout of the configuration file directories, mechanisms for editing the files, and learn more about the files themselves. See Understanding Configuration Files.

Configuring Virtual Hosts

You can create virtual hosts to run more than one website (such as www.company1.com and www.company2.com) on a single machine. Virtual hosts can be IP-based, meaning that you have a different IP address for every website, or name-based, meaning that you have multiple names running on each IP address. The fact that the virtual ports run on the same physical server is not apparent to the end user.

Caution:

The Oracle HTTP Server administration virtual host and its configuration, defined in the admin.conf file, must not be edited with the WebLogic Scripting Tool (WLST).

The current release of Oracle HTTP Server enables you to use IPv6 and IPv4 addresses as the virtual host name.

You can also configure multiple addresses for the same virtual host; that is, a virtual host can be configured to serve on multiple addresses. This allows requests to different addresses to be served with the same content from the same virtual host.

This section describes how to create and edit virtual hosts using Fusion Middleware Control.

See Also:

For more information about virtual hosts, see Apache HTTP Server documentation.

Creating Virtual Hosts Using Fusion Middleware Control

You can create a virtual host for Oracle HTTP Server on the Fusion Middleware Control Create Virtual Hosts page. To create a virtual host using Fusion Middleware Control, do the following:

  1. Navigate to the Oracle HTTP Server home page.
  2. Select Administration from the Oracle HTTP Server menu.
  3. Select Virtual Hosts from the Administration menu.
  4. Click Create.
  5. In the Create Virtual Host screen, enter a name for the virtual host field and then choose whether to enter a new listen address or to use an existing listen address.
    • New listen address - Use this option when you want to create a virtual host that maps to a specific hostname, IP address, or IPv6 address, for example mymachine.com:8080. This will create the following VirtualHost directive:

      <VirtualHost mymachine.com:8080>
      
    • Use existing listen address - Use this option when you want to create a virtual host using an existing listen port and the one that maps to all IP addresses. This will create following type VirtualHost directive:

      <VirtualHost *:8080>
      

    Note:

    If you attempt to create a virtual host with a wildcard character, for example, *:port and no listen directive exists for that port, then the virtual host creation will fail.

    In this case, you must first add the listen directive, and then try to add the virtual host.

  6. Enter the remaining attributes for the new virtual host.
    • Server Name - The name of the server for Oracle HTTP Server

    • Document Root - Documentation root directory that forms the main document tree visible from the website

    • Directory Index - The main (index) page that will be displayed when a client first accesses the website

    • Administrator's E-mail Address - The e-mail address that the server will include in error messages sent to the client

  7. Click OK.
  8. Restart Oracle HTTP Server. See Restarting Oracle HTTP Server Instances.

Removing Unnecessary Listen Directives

Creating a virtual host by using Fusion Middleware Control also adds the Listen directive for the virtual host. However, virtual host creation will add unnecessary Listen directives in the following situations:

  • A virtual host is being created for one host name and the Listen directive already exists for the different host name resolving to the same IP address.

  • A virtual host is being created for one host name and the Listen directive already exists for the IP address that the host name resolves to.

  • A virtual host is being created for multiple host names that resolve to the same IP address.

In these situations, Oracle HTTP Server will fail to start because there are multiple Listen directives for the same IP address. You must remove any extra Listen directives configured for the same IP address.

Configuring Virtual Hosts Using Fusion Middleware Control

You can use the options on the Configure menu of the Virtual Hosts page to specify Server, MIME, Log, SSL, and mod_wl_ohs configuration for a selected virtual host.

To configure a virtual host using Fusion Middleware Control, do the following:

  1. Navigate to the Oracle HTTP Server home page.
  2. Select Administration from the Oracle HTTP Server menu.
  3. Select Virtual Hosts from the Administration menu.
  4. Highlight an existing virtual host in the table.
  5. Click Configure.
  6. Select one of the following options from the Configure menu to open its corresponding configuration page. The values on these pages apply only to the virtual host. If the fields are blank, the virtual host uses the values configured at the server level.
  7. Review the settings on each configuration page. If the settings are correct, click OK to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Cancel to return to the original settings.
  8. Restart Oracle HTTP Server. See Restarting Oracle HTTP Server Instances.