5 Managing Ports

You can view and change Oracle Fusion Middleware port numbers, such as those used by Oracle WebLogic Server or Oracle HTTP Server.

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 Port Numbers for a list of port numbers commonly assigned during installation. Refer to the installation guide for directions on overriding port assignments during installation.

Viewing Port Numbers

Often, you need to know which port numbers your Oracle Fusion Middleware environment uses.

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

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

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:

    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.

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.

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

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.

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 Fusion Middleware Control or WLST.

See Configuring the Listen Port in Administering Server Environments for Oracle WebLogic Server for more information about changing Oracle WebLogic Server ports.

Changing the Oracle WebLogic Server Listen Ports Using Fusion Middleware Control

To change the non-SSL (HTTP) listen port and the SSL (HTTPS) listen port for an Administration Server or a Managed Server using Fusion Middleware Control:

  1. From the target navigation pane, select the server.
  2. From the WebLogic Server menu, select Administration, then General Settings.
  3. Select the Configuration tab. On the General Settings tab, change the number of the Listen Port or SSL Listen Port.
  4. If the server is running, restart the server.
  5. If other components rely on the Oracle WebLogic Server listen ports, you must reconfigure those components.
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()

Changing the Node Manager Listen Port

You can change the Node Manager listen port using Fusion Middleware Control or WLST, as described in the following topics:

Changing the Node Manager Listen Port Using WLST

To change the Node Manager Listen Port using WLST:

readDomain('Domain_Home')
cd('/')
cd('NMProperties')
set('ListenPort',new_port_number)
updateDomain()
Changing the Node Manager Listen Port Using Fusion Middleware Control

To change the Node Manager Listen Port using Fusion Middleware Control, change the configuration of the machine to point it to the new port:

  1. Edit the Node Manager properties file, changing the Listen Port property. For a domain-based Node Manager, the file is located at:
    DOMAIN_HOME/nodemanager/nodemanager.properties
    
  2. From the WebLogic Domain menu, select Environment and then Machines.
  3. On the Machines page, select the machine.
  4. Select the Configuration tab.
  5. Select the Node Manager tab.
  6. Change the Listen Port to the new port number.
  7. Click Save.

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:

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.

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 Enabling Oracle HTTP Server to Run as Root for Ports Set to Less Than 1024 (UNIX Only).

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. From the Oracle HTTP Server menu, choose Administration, then Advanced Configuration.
  6. Select the related configuration file and modify the related VirtualHost directive, changing the VirtualHost's old listen port value to the new value. For example:
    <VirtualHost *:4443> 

    Save the configuration.

  7. Restart Oracle HTTP Server. (From the Oracle HTTP Server menu, choose Control, then Restart.)
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 Enabling Oracle HTTP Server to Run as Root for Ports Set to Less Than 1024 (UNIX Only).

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. From the Oracle HTTP Server menu, choose Administration, then Advanced Configuration.
  6. Select the related configuration file and modify the related VirtualHost directive, changing the VirtualHost's old listen port value to the new value. For example:
    <VirtualHost *:4443> 

    Save the configuration.

  7. Restart Oracle HTTP Server. (From the Oracle HTTP Server menu, choose Control, then Restart.)
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:

  1. Make a copy of the following configuration files.
    DOMAIN_HOME/config/fmwconfig/components/OHS/component_name/httpd.conf
    DOMAIN_HOME/config/fmwconfig/components/OHS/component_name/admin.conf
    DOMAIN_HOME/config/fmwconfig/components/OHS/component_name/ssl.conf
  2. Modify the following configuration files and any other configuration files that hold the port values:
    DOMAIN_HOME/config/fmwconfig/components/OHS/component_name/httpd.conf
    DOMAIN_HOME/config/fmwconfig/components/OHS/component_name/ssl.conf
  3. In the files, replace the non-SSL and SSL Listen ports with the new values.
  4. In the files, modify the related Virtual Host ports.

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, Oracle Database 11g, Oracle Database 12c 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, Oracle Database 11g, Oracle Database 12c 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 Changing the KEY Value for an IPC Listener

To change the database listener port:

  1. Stop all components that use the metadata repository. See Starting and Stopping Oracle Fusion Middleware for instructions.

  2. On the metadata repository host, change the Oracle Net listener port for the metadata repository:

    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:

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

      • 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
      
  3. 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.)

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