7 Managing Connectivity

This chapter describes how to manage Oracle HTTP Server connectivity. It includes procedures for viewing port number usage, managing ports, and configuring virtual hosts.

This chapter includes the following sections:

7.1 Default Listen Ports

Automatic port assignment occurs only if you use createOHSInstance() 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-7877, is assigned. The default SSL port is 4443. Similarly, if port 4443 is occupied, the next available port number, within a range of 4443-4543, 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 Section 4.2, "Creating an OHS Instance".

7.2 Defining the Admin Port

Automatic Admin or Proxy MBean port assignment occurs only if you use createOHSInstance() or Fusion Middleware Control. The Admin port is an additional SSL port (default value 9999) that is used internally by Oracle HTTP Server to communicate with Fusion Middleware Control. It is also used to monitor Oracle HTTP Server. This port is configured in the admin.conf file.

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.

7.3 Viewing Port Number Usage

This section describes how to view ports using Fusion Middleware Control or WLST.

7.3.1 Using the Fusion Middleware Control to View Port Number Usage

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, as illustrated in the following figure:

    Description of ports2.gif follows
    Description of the illustration ''ports2.gif''

7.3.2 Using WLST to View Port Number Usage

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/ohs/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']) 

7.4 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 (proxy MBean) 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.
Description of ports_config.gif follows
Description of the illustration ''ports_config.gif''

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.

7.4.1 Using Fusion Middleware Control to Create Ports

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.

    Description of ports_config_new.gif follows
    Description of the illustration ''ports_config_new.gif''

  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 Section 7.5.2, "Using Fusion Middleware Control to Configure Virtual Hosts".

  6. In Port, enter the port number.

  7. Click OK.

  8. Restart Oracle HTTP Server. See Section 4.3.4.

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. For more information, see "Registering Oracle HTTP Server mod_osso with OSSO Server 10.1.4" in Securing Applications with Oracle Platform Security Services.

7.4.2 Using Fusion Middleware Control to Edit Ports

To create 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 Fusion Middleware Control, 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.

    Description of ports_config_create.gif follows
    Description of the illustration ''ports_config_create.gif''

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

    You can configure SSL for a port on the Virtual Hosts page, as described in Section 7.5.2, "Using Fusion Middleware Control to Configure Virtual Hosts".

  7. Click OK.

  8. Restart Oracle HTTP Server. See Section 4.3.4.

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.

7.4.3 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 (DOMAIN_HOME/config/fmwconfig/components/OHS/componentName/httpd.conf) 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. For this information, see Section 1.6, "Understanding Configuration Files".

7.5 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 they are running on the same physical server is not apparent to the end user.

Caution:

The Oracle HTTP Server administration (proxy MBean) 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, you can configure a virtual host 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, refer to the Apache HTTP Server documentation.
Description of virtual_hosts.gif follows
Description of the illustration ''virtual_hosts.gif''

7.5.1 Using Fusion Middleware Control to Create Virtual Hosts

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.

    Description of virtual_hosts_create.gif follows
    Description of the illustration ''virtual_hosts_create.gif''

  5. 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 following type NameVirtualHost and VirtualHost directives:

      NameVirtualHost mymachine.com:8080
      <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.

  7. Use the Type field to select whether the virtual host will be IP-based or name-based.

  8. Click OK.

  9. Restart Oracle HTTP Server. See Section 4.3.4.

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.

7.5.2 Using Fusion Middleware Control to Configure Virtual Hosts

You can use the options on the Configure menu to specify Server, MIME, Log, mod_perl, 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.

    Description of virtual_hosts_config.gif follows
    Description of the illustration ''virtual_hosts_config.gif''

  6. Select one of the following options from 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 Section 4.3.4, "Restarting Oracle HTTP Server Instances".