9 Managing Listeners

Connections between the clients and Oracle Traffic Director instances are created through HTTP and TCP listeners. Each listener is a unique combination of an IP address (or host name) and a port number.

This chapter describes how to create, view, modify, and delete listeners. It contains the following topics:

9.1 Creating a Listener

You can create listeners by using either Fusion Middleware Control or the WLST.

Note:

For information about using WLST, see Section 1.7.1, "Accessing WebLogic Scripting Tool."

Before You Begin

Before you begin creating an listener, decide the following:

  • A unique name for the listener. Choose the name carefully; after creating a listener, you cannot change its name.

  • A unique IP address (or host name) and port number combinations for the listener.

    You can define multiple listeners with the same IP address combined with different port numbers, or with a single port number combined with different IP addresses. So each of the following IP address and port number combinations would be considered a unique listener:

    10.10.10.1:80
    10.10.10.1:81
    10.10.10.2:80
    10.10.10.2:81
    
  • For HTTP listeners: The default virtual server for the listener.

    Oracle Traffic Director routes requests to the default virtual server if it cannot match the Host value in the request header with the host patterns specified for any of the virtual servers bound to the listener.

    For information about specifying the host patterns for virtual servers, see Section 7.1, "Creating a Virtual Server."

  • For HTTP listeners: The server name to be included in any URLs that are generated automatically by the server and sent to the client. This server name should be the virtual host name, or the alias name if your server uses an alias. If a colon and port number are appended to the server name then that port number is used in the autogenerated URLs.

  • For TCP listeners: TCP proxy for the listener.

    A TCP proxy handles TCP requests through TCP listeners for traffic tunnelling. A TCP proxy can have several TCP listeners associated with it. You can associate TCP listeners and configure TCP proxy settings from this page.

    For more information about creating TCP proxies, see Section 8.1, "Creating a TCP Proxy."

Creating an HTTP Listener Using Fusion Middleware Control

To create an HTTP listener by using the Fusion Middleware Control, do the following:

  1. Log in to Fusion Middleware Control, as described in Section 1.7.2, "Displaying Fusion Middleware Control."

  2. Click the WebLogic Domain button at the upper left corner of the page.

  3. Select Administration > OTD Configurations.

    A list of the available configurations is displayed.

  4. Select the configuration for which you want to create a HTTP Listener.

  5. Click the Traffic Director Configuration In the Common Tasks pane.

  6. Select Administration > Listener.

  7. In the Common Tasks pane, click Create under HTTP Listener.

    The New HTTP Listener wizard starts.

    Figure 9-1 New HTTP Listener Wizard

    Description of Figure 9-1 follows
    Description of ''Figure 9-1 New HTTP Listener Wizard''

  8. Follow the on-screen prompts to complete creation of the HTTP listener by using the details—listener name, IP address, port, and so on—that you decided earlier.

    Note:

    If certificates are available in the configuration, in the second screen of the wizard, an SSL/TLS check box will be available. If you want the new listener to receive HTTPS requests, click the check box to enable SSL/TLS and then select the appropriate certificate from the drop-down list.

    After the HTTP listener is created, the Results screen of the New HTTP Listener wizard displays a message confirming successful creation of the listener.

  9. Click OK on the Results screen.

    • The details of the listener that you just created are displayed on the Listeners page.

Creating a TCP Listener Using Fusion Middleware Control

To create a TCP listener by using the Fusion Middleware Control, do the following:

  1. Perform steps 1, 2, and 3 of "Creating an HTTP Listener Using Fusion Middleware Control"

  2. Click the WebLogic Domain button at the upper left corner of the page.

  3. Select Administration > OTD Configurations.

    A list of the available configurations is displayed.

  4. Select the configuration for which you want to create a TCP Listener.

  5. Click the Traffic Director Configuration In the Common Tasks pane.

  6. Select Administration > Listener.

  7. In the Common Tasks pane, click Create TCP Listener.

    The New TCP Listener wizard starts.

    Figure 9-2 New TCP Listener Wizard

    Description of Figure 9-2 follows
    Description of ''Figure 9-2 New TCP Listener Wizard''

  8. Follow the on-screen prompts to complete creation of the TCP listener by using the details—listener name, IP address, port, and so on—that you decided earlier.

    Note:

    If certificates are available in the configuration, in the second screen of the wizard, an SSL/TLS check box will be available. If you want the new listener to receive T3S requests, click the check box to enable SSL/TLS and then select the appropriate certificate from the drop-down list.

    After the TCP listener is created, the Results screen of the New TCP Listener wizard displays a message confirming successful creation of the listener.

  9. Click OK on the Results screen.

    • The details of the listener that you just created are displayed on the Listeners page.

Creating a Listener Using WLST

  • To create an HTTP listener, run the otd_createHttpListener command.

    For example, the following command creates an HTTP listener named http-listener-1 for the configuration foo with the port as 23456 and the default virtual server as bar.

    props = {}
    props['configuration'] = 'foo'
    props['http-listener'] = 'http-listener-1'
    props['port'] = '23456'
    props['server-name'] = 'example.com'
    props['default-virtual-server-name'] = 'bar'
    otd_createHttpListener(props)
    
  • To create a TCP listener, run the otd_createTcpListener command.

    For example, the following command creates a TCP listener named tcp_listener_1 for the configuration foo with the port as 34567 and the TCP proxy as tcp_proxy-1.

    props = {}
    props['configuration'] = 'foo'
    props['tcp-listener'] = 'tcp-listener-1'
    props['port'] = '34567'
    props['tcp-proxy-name'] = 'tcp-proxy-1'
    otd_createTcpListener(props)
    

For more information about otd_createHttpListener and otd_createTcpListener, see WebLogic Scripting Tool Command Reference for Oracle Traffic Director.

9.2 Viewing a List of Listeners

You can view a list of HTTP or TCP listeners by using either Fusion Middleware Control or the WLST.

Note:

For information about invoking WLST, see Section 1.7.1, "Accessing WebLogic Scripting Tool."

Viewing a List of Listeners Using Fusion Middleware Control

To view a list of HTTP or TCP listeners by using the Fusion Middleware Control, do the following:

  1. Log in to Fusion Middleware Control, as described in Section 1.7.2, "Displaying Fusion Middleware Control."

  2. Click the WebLogic Domain button at the upper left corner of the page.

  3. Select Administration > OTD Configurations.

    A list of the available configurations is displayed.

  4. Select the configuration for which you want to view a HTTP or TCP Listener.

  5. Click the Traffic Director Configuration In the Common Tasks pane.

  6. Select Administration > Listener.

    The Listeners page is displayed. It shows a list of the listeners defined for the configuration.

    Note:

    HTTP and TCP listeners can also be identified by their icons.

You can view the properties of a listener in detail by clicking on its name.

Viewing a List of Listeners Using WLST

  • To view a list of HTTP listeners, run the otd_listHttpListeners command, as shown in the following example:

    props = {}
    props['configuration'] = 'foo'
    otd_listHttpListeners(props)
    
    listener-1 
    listener-2 
    

    You can view the properties of an HTTP listener in detail by running the otd_getHttpListenerProperties command.

    For more information about the otd_listHttpListeners and gotd_getHttpListenerProperties commands, see WebLogic Scripting Tool Command Reference for Oracle Traffic Director.

  • To view a list of TCP listeners, run the otd_listTcpListeners command, as shown in the following example:

    props = {}
    props['configuration'] = 'foo'
    otd_listTcpListeners(props)
    
    listener-1 
    listener-2 
    

    You can view the properties of an TCP listener in detail by running the otd_getTcpListenerProperties command.

    For more information about the otd_listTcpListeners and otd_getTcpListenerProperties commands, see WebLogic Scripting Tool Command Reference for Oracle Traffic Director.

9.3 Modifying a Listener

You can modify listeners by using either Fusion Middleware Control or the WLST.

Note:

For information about invoking WLST, see Section 1.7.1, "Accessing WebLogic Scripting Tool."

Modifying a Listener Using Fusion Middleware Control

To modify an HTTP or TCP listener by using the Fusion Middleware Control, do the following:

  1. Log in to Fusion Middleware Control, as described in Section 1.7.2, "Displaying Fusion Middleware Control."

  2. Click the WebLogic Domain button at the upper left corner of the page.

  3. Select Administration > OTD Configurations.

    A list of the available configurations is displayed.

  4. Select the configuration for which you want to modify a HTTP or TCP Listener.

  5. Click the Traffic Director Configuration In the Common Tasks pane.

  6. Select Administration > Listener.

    The Listeners page is displayed. It shows a list of the HTTP or TCP listeners defined for the configuration.

  7. Click the name of the listener that you want to modify.

    The Listener Settings page is displayed. On this page, you can do the following:

    • Enable and disable the listener.

    • Change the listener port number and IP address.

    • For HTTP listeners: Change the server name and the default virtual server.

    • For TCP listeners: Change the TCP proxy.

    • If server certificates have been created for the configuration, you can enable SSL/TLS and configure SSL/TLS settings for the listener. For more information, see Section 10.1.2, "Configuring SSL/TLS for a Listener."

    • Change the protocol family—IPv4, IPv6, or SDP—for which the listener should accept requests.

    • For HTTP listeners: Configure parameters to tune the performance of the virtual server—the number of acceptor threads, the listen queue size, receive buffer size, and so on. For more information, see Section 14.4, "Tuning HTTP Listener Settings."

  8. Specify the parameters that you want to change.

    On-screen help and prompts are provided for all of the parameters.

    When you change the value in a field or tab out of a text field that you changed, the Save button near the upper right corner of the page is enabled.

    At any time, you can discard the changes by clicking the Reset button.

  9. After making the required changes, click Save.

    • A message, confirming that the updated listener was saved, is displayed in the Console Messages pane.

    • In addition, the Deployment Pending message is displayed at the top of the main pane. You can either deploy the updated configuration immediately by clicking Deploy Changes, or you can do so later after making further changes as described in Section 3.3, "Activate Configuration Changes."

Modifying a Listener Using WLST

  • To change the properties of an HTTP listener, run the otd_setHttpListenerProperties command. For example, the following command changes the maximum requests per connection of the listener http-listener-1 in the configuration foo to 1024.

    props = {}
    props['configuration'] = 'foo'
    props['http-listener'] = 'http-listener-1'
    props['max-requests-per-connection'] = '1024'
    otd_setHttpListenerProperties(props)
    

    To change the SSL/TLS settings of an HTTP listener, run the otd_setHttpListenerSslProperties command. For example, the following command disables TLS 1.0 support for the listener http-listener-1 in the configuration foo.

  • props = {}
    props['configuration'] = 'foo'
    props['http-listener'] = 'http-listener-1'
    props['tls10'] = 'false'
    otd_setHttpListenerSslProperties(props)
    

    To change the properties of a TCP listener, run the otd_setTcpListenerProperties command. For example, the following command changes the maximum requests per connection of the listener tcp-listener-1 in the configuration foo to 1024.

  • props = {}
    props['configuration'] = 'foo'
    props['tcp-listener'] = 'tcp-listener-1'
    props['max-requests-per-connection'] = '1024'
    otd_setTcpListenerProperties(props)
    

    To change the SSL/TLS settings of an TCP listener, run the otd_setTcpListenerSslProperties command. For example, the following command disables TLS 1.0 support for the listener tcp-listener-1 in the configuration foo.

  • props = {}
    props['configuration'] = 'foo'
    props['tcp-listener'] = 'tcp-listener-1'
    props['tls10'] = 'false'
    otd_setTcpListenerSslProperties(props)
    

For a list of the properties that you can set or change by using the otd_setTcpListenerProperties and SslProperties commands, see WebLogic Scripting Tool Command Reference for Oracle Traffic Director.

9.4 Deleting a Listener

You can delete HTTP or TCP listeners by using either Fusion Middleware Control or the WLST.

Note:

For information about invoking WLST, see Section 1.7.1, "Accessing WebLogic Scripting Tool."

Deleting a Listener Using Fusion Middleware Control

To delete an HTTP or TCP listener by using the Fusion Middleware Control, do the following:

  1. Log in to Fusion Middleware Control, as described in Section 1.7.2, "Displaying Fusion Middleware Control."

  2. Click the WebLogic Domain button at the upper left corner of the page.

  3. Select Administration > OTD Configurations.

    A list of the available configurations is displayed.

  4. Select the configuration for which you want to delete a HTTP or TCP Listener.

  5. Click the Traffic Director Configuration In the Common Tasks pane.

  6. Select Administration > Listener.

    The Listeners page is displayed. It shows a list of the HTTP/TCP listeners defined for the configuration.

  7. Click the Delete icon for the listener that you want to delete.

    A prompt to confirm deletion of the listener is displayed.

    Note:

    For HTTP listeners: If the HTTP listener is associated with any virtual servers, the prompt shows the names of those virtual servers.
  8. To proceed with the deletion, click Yes.

    A message is displayed in the Console Message pane confirming that the HTTP/TCP listener was deleted.

Deleting a Listener Using WLST

  • To delete an HTTP listener, run the otd_deleteHttpListener command, as shown in the following example:

    props = {}
    props['configuration'] = 'foo'
    props['http-listener'] = 'http-listener-1'
    otd_deleteHttpListener(props)
    

    To delete an TCP listener, run the otd_deleteTcpListener command, as shown in the following example:

    props = {}
    props['configuration'] = 'foo'
    props['tcp-listener'] = 'tcp-listener-1'
    otd_deleteTcpListener(props)
    

For more information about otd_deleteHttpListener and otd_deleteTcpListener, see WebLogic Scripting Tool Command Reference for Oracle Traffic Director.

9.5 Configure OTD to listen on privileged ports

You can configure OTD to listen on privileged ports by the following steps.

  1. To create listen sockets for previlaged ports, OTD bundles a binary named 'portbind'.

  2. If OTD needs to listen at privileged ports, an admin needs to provide root ownership and setuid privileges to 'portbind'

    • chown root portbind.

    • chmod 4750 portbind.

  3. It should be ensured that the server user has the required group ownerships for the above to work

  4. The OTD watchdog process uses 'portbind' to create listen sockets that require privileged ports