5 Managing Ports

This chapter describes how to view and change Oracle Fusion Middleware port numbers, such as those used by Oracle WebLogic Server or Oracle HTTP Server.

It contains the following sections:

5.1 About Managing Ports

Many Oracle Fusion Middleware components and services use ports. Most port numbers are assigned during domain creation. As an administrator, it is important to know the port numbers used by these services, and to ensure that the same port number is not used by two services on your host.

For some ports, you can specify a port number assignment during domain creation.

See Also:

Appendix D for a list of port numbers. Refer to the installation guide for directions on overriding port assignments during installation.

5.2 Viewing Port Numbers

You can view the port numbers currently in use with the command line or Fusion Middleware Control, as described in the following topics:

5.2.1 Viewing Port Numbers Using the Command Line

To view the port numbers for Oracle WebLogic Server, you can use the WLST get command, with an attribute. For example, to get the Administration Port, use the following command:

wls:/WLS_domain/serverConfig> get('AdministrationPort')
9002

5.2.2 Viewing Port Numbers Using Fusion Middleware Control

You can view the port numbers of the domain, the Administration Server, Managed Servers, or components, such as Oracle HTTP Server, using Fusion Middleware Control.

For example, to view the ports of a domain:

  1. From the WebLogic Domain menu, choose Monitoring, then Port Usage.

    The Port Usage page is displayed, as shown in the following figure:

    Description of ports.gif follows
    Description of the illustration ports.gif

    Optionally, you can filter the ports shown by selecting a Managed Server from Show.

The Port Usage detail table shows the ports that are in use, the IP Address, the component, the channel, and the protocol.

You can also view similar pages for the Administration Server, Managed Servers, and components, such as Oracle HTTP Server, by navigating to the target and choosing Port Usage from the target's menu.

5.3 Changing the Port Numbers Used by Oracle Fusion Middleware

You can change the port numbers for some Oracle Fusion Middleware components, using Fusion Middleware Control, Oracle WebLogic Server Administration Console, or the command line.

Note:

You can change a port number to any number you want, if it is an unused port. You do not have to use a port in the allotted port range for the component. See Appendix D for information on allotted port ranges.

This section provides the following topics:

For information about changing other ports, see:

  • "Configuring Node Manager" in Administering Node Manager for Oracle WebLogic Server for information about changing the Node Manager port.

5.3.1 Changing the Oracle WebLogic Server Listen Ports

You can change the non-SSL (HTTP) listen port and the SSL (HTTPS) listen port for an Administration Server or a Managed Server using the Oracle WebLogic Server Administration Console or WLST, as described in the following topics:

See Administering Server Environments for Oracle WebLogic Server for more information about changing Oracle WebLogic Server ports.

5.3.1.1 Changing the Oracle WebLogic Server Listen Ports Using the Administration Console

To change the non-SSL (HTTP) listen port and the SSL (HTTPS) listen port for an Administration Server or a Managed Server using the Oracle WebLogic Server Administration Console:

  1. Navigate to the server.

    The Settings for server_name page is displayed.

  2. Select the Configuration tab. On the General tab, change the number of the Listen Port or SSL Listen Port.

  3. If the server is running, restart the server.

  4. If other components rely on the Oracle WebLogic Server listen ports, you must reconfigure those components.

5.3.1.2 Changing the Oracle WebLogic Server Listen Ports Using WLST

To change the non-SSL (HTTP) listen port and the SSL (HTTPS) listen port for an Administration Server or a Managed Server using the WLST command line. You must run the commands in offline mode; that is, you must not be connected to a server.

For example, to change the Administration Server HTTP listen port to port 8001, use the following WLST commands:

readDomain("oracle/config/domains/domain_name")
cd("servers/AdminServer")
cmo.setListenPort(8001)
updateDomain()

5.3.2 Changing the Oracle HTTP Server Listen Ports

To change the Oracle HTTP Server Listen ports (non-SSL or SSL), there are often dependencies that must also be set.

The following topics describe how to modify the Oracle HTTP Server HTTP or HTTPS Listen port:

5.3.2.1 Enabling Oracle HTTP Server to Run as Root for Ports Set to Less Than 1024 (UNIX Only)

By default, Oracle HTTP Server runs as a non-root user (the user that installed Oracle Fusion Middleware). On UNIX systems, if you change the Oracle HTTP Server Listen port number to a value less than 1024, you must enable Oracle HTTP Server to run as root.

For information about enabling the Listen port to run as root see "Starting Oracle HTTP Server Instances on a Privileged Port (Unix Only)" in Administering Oracle HTTP Server.

5.3.2.2 Changing the Oracle HTTP Server Non-SSL Listen Port in a WebLogic Server Domain

To change the Oracle HTTP Server non-SSL (HTTP) Listen port, take the following steps. Note that, on a UNIX system, if you are changing the Listen port to a number less than 1024, you must first perform the steps in Section 5.3.2.1.

To change the Oracle HTTP Server Listen port using Fusion Middleware Control:

  1. From the navigation pane, expand HTTP_Server. Then select the Oracle HTTP Server instance.

  2. From the Oracle HTTP Server menu, choose Administration, then Ports Configuration.

  3. Select the Listen port that uses the HTTP protocol, then click Edit.

  4. Change the port number, then click OK.

  5. Restart Oracle HTTP Server. (From the Oracle HTTP Server menu, choose Control, then Restart.)

5.3.2.3 Changing the Oracle HTTP Server SSL Listen Port in a WebLogic Server Domain

To change the Oracle HTTP Server SSL (HTTPS) Listen port, take the following steps. Note that, on a UNIX system, if you are changing the Listen port to a number less than 1024, you must perform the steps in Section 5.3.2.1.

To change the Oracle HTTP Server SSL Listen port using Fusion Middleware Control:

  1. From the navigation pane, expand HTTP_Server. Then select the Oracle HTTP Server instance.

  2. From the Oracle HTTP Server menu, choose Administration, then Ports Configuration.

  3. Select the Listen port that uses the HTTPS protocol, then click Edit.

  4. Change the port number, then click OK.

  5. Restart Oracle HTTP Server. (From the Oracle HTTP Server menu, choose Control, then Restart.)

5.3.2.4 Changing the Oracle HTTP Server Listen Ports in a Standalone Domain

To change the Oracle HTTP Server non-SSL and SSL Listen ports in a standalone domain, modify the following files:

DOMAIN_HOME/config/fmwconfig/components/OHS/instances/component_name/httpd.conf
DOMAIN_HOME/config/fmwconfig/components/OHS/instances/component_name/admin.conf
DOMAIN_HOME/config/fmwconfig/components/OHS/instances/component_name/ssl.conf

5.3.3 Changing the Oracle Database Net Listener Port

If your environment includes an Oracle Database that functions as a metadata repository, and you want to change the listener port number for that database, perform the procedure in this section.

First, determine if it is necessary to change the listener port number. If you are concerned that you have another database on your host using the same port, both databases can possibly use the same port.

Note that multiple Oracle Database 10g and Oracle Database 11g databases can share the same Oracle Net listener port. If you are using an Oracle Database as a metadata repository on the same host that contains another Oracle Database 10g or Oracle Database 11g database, they can all use port 1521. There is no need to change the listener port number.

Note:

To run two listeners that use the same key value on one host, refer to Section 5.3.3.1, "Changing the KEY Value for an IPC Listener"

The procedure consists of the following tasks:

Task 1   Stop Components

Stop all components that use the Metadata Repository. See Chapter 4 for instructions.

Task 2   Change the Metadata Repository for Oracle Net Listener Port

On the metadata repository host:

  1. Ensure that the ORACLE_HOME and ORACLE_SID environment variables are set.

  2. Stop the metadata repository listener:

    lsnrctl stop
    
  3. Edit the listener.ora file, which is located at:

    (UNIX) ORACLE_HOME/network/admin/listener.ora
    (Windows) ORACLE_HOME\network\admin\listener.ora
    

    Under the LISTENER entry, update the value for PORT. Save the file.

  4. Edit the tnsnames.ora file. The default location is:

    (UNIX) ORACLE_HOME/network/admin/tnsnames.ora
    (Windows) ORACLE_HOME\network\admin\tnsnames.ora
    

    Make the following changes to the file:

    1. Update the PORT value in each entry that applies to MDS Repository.

    2. Add an entry similar to the following:

      newnetport =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = tcp) (HOST = hostname) (PORT = port)))
      

      In the example, hostname is the fully qualified host name and port is the new port number.

  5. Start the metadata repository listener:

    lsnrctl start
    
  6. Using SQL*Plus, log in to the metadata repository as the SYSTEM user with SYSDBA privileges and run the following command:

    SQL> ALTER SYSTEM SET local_listener='newnetport' scope=spfile;
    
  7. Using SQL*Plus, restart the metadata repository:

    SQL> SHUTDOWN
    SQL> STARTUP
    
    (UNIX) DOMAIN_HOME/bin/startComponent.sh OID1
    (Windows) DOMAIN_HOME\bin\startComponent.cmd OID1
    
Task 3   Change the System Data Source

Change the system data source to use the new port number for the metadata repository. To do so, you can use Fusion Middleware Control:

  1. In the Change Center, click Lock & Edit.

  2. In the navigation pane, expand select the domain.

    The WebLogic Domain page is displayed.

  3. From the WebLogic Domain menu, select JDBC Data Sources.

    The Summary of JDBC Data Sources page is displayed.

  4. Select the data source you want to change.

    The JDBC Data Source page is displayed.

  5. Select the Connection Pool tab.

  6. To change the database port, modify the Database URL field. For example:

    jdbc:oracle:thin:@hostname.domainname.com:1522/orcl
    
  7. Click Save.

  8. Restart the servers that use this data source. (Click the Targets tab to see the servers that use this data source.)

5.3.3.1 Changing the KEY Value for an IPC Listener

It is not possible to run two listeners at the same time that are configured to use the same KEY value in their IPC protocol address. By default, the metadata repository listener has its IPC KEY value set to EXTPROC. Hence, if your computer has another IPC listener that uses the EXTPROC key, you should configure the metadata repository listener to use some other key value such as EXTPROC1.

To change the KEY value of an IPC listener:

  1. Stop the listener (ensure that your ORACLE_HOME environment variable is set first):

    lsnrctl stop
    
  2. Edit the listener.ora and tnsnames.ora files. In each file, find the following line:

    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    

    Change it to the following:

    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    
  3. Restart the listener:

    lsnrctl start