11 Managing Listeners
This chapter describes how to create, view, modify, and delete listeners. It contains the following topics:
Creating a Listener
You can create listeners to bind them to a virtual server and configure them to forward requests to different origin-server pools. To create a HTTP listener, run the otd_createHttpListener
command, and to create a TCP listener, run the otd_createTcpListener
command.
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 Creating Virtual Servers. -
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. See Creating a TCP Proxy.
Topics
You can create listeners by using either Fusion Middleware Control or WLST as described in the following topics:
Creating a Listener Using Fusion Middleware Control
To create an HTTP listener by using the Fusion Middleware Control, do the following:
-
Log in to Fusion Middleware Control, as described in Graphical User Interface-Fusion Middleware Control.
-
Click the WebLogic Domain button at the upper left corner of the page.
-
Select Administration > OTD Configurations.
A list of the available configurations is displayed.
-
Select the configuration for which you want to create a HTTP Listener.
-
Click the Traffic Director Configuration In the Common Tasks pane.
-
Select Administration > Listener.
-
In the Common Tasks pane, click Create under HTTP Listener.
The New HTTP Listener wizard appears.
-
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.
-
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:
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 configurationfoo
with the port as23456
and the default virtual server asbar
.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 configurationfoo
with the port as34567
and the TCP proxy astcp_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)
Viewing a List of Listeners
After creating listeners, you can view the current list of listeners. To view the list of listeners, run the otd_listHttpListeners
or the otd_listTcpListeners
commands.
Topics
You can view the list of listeners by using either Fusion Middleware Control or WLST as described in the following topics:
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:
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.
-
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 a TCP listener in detail by running the
otd_getTcpListenerProperties
command.
Modifying a Listener
After you create a listener, you may need to modify some of the settings such as, listener port number, IP address, protocol family, and so on.
Topics
You can modify the listener settings by using either Fusion Middleware Control or WLST as described in the following topics:Modifying a Listener Using Fusion Middleware Control
To modify an HTTP or TCP listener by using the Fusion Middleware Control, do the following:
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 listenerhttp-listener-1
in the configurationfoo
to1024
.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 listenerhttp-listener-1
in the configurationfoo
. 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 listenertcp-listener-1
in the configurationfoo
to1024
.
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 listenertcp-listener-1
in the configurationfoo
.props = {} props['configuration'] = 'foo' props['tcp-listener'] = 'tcp-listener-1' props['tls10'] = 'false' otd_setTcpListenerSslProperties(props)
Deleting a Listener
You can delete listeners that are no longer required. To delete listeners, run the otd_deleteHttpListener
or the otd_deleteTcpListener
command.
Topics
You can delete listeners by using either Fusion Middleware Control or WLST as described in the following topics:
Deleting a Listener Using Fusion Middleware Control
To delete an HTTP or TCP listener by using the Fusion Middleware Control, do the following:
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)
Configuring Status Listener
You can now configure dedicated status listeners to check the status of Oracle Traffic Director instances. Using a dedicated port to serve Oracle Traffic Director status ensures that Oracle Traffic Director is available to service status requests even when it is loaded.
In addition, you can secure the status listener by configuring SSL settings for the port.
You can configure listeners by using either Fusion Middleware Control or the WLST.
Configuring Status Listener using Fusion Middleware Control
To configure status listener by using the Fusion Middleware Control, do the following:
Configuring Status Listener Using WLST
-
Enabling/changing properties of a status listener
To enable a status listener or to change the non-SSL properties of a status listener, run the
otd_enableStatusListener
command, as shown in the example:-
To enable a status listener
props = {} props['configuration'] = 'foo' props['port'] = '12345' otd_enableStatusListener(props)
-
To change the non-SSL properties of a status listener
Consider a status listener which was enabled as shown in the previous example. This means that the
ip
andfamily
values are*
anddefault
respectively. To re-configure the IP address and port for this status listener, run theotd_enableStatusListener
command, as shown in the example:props = {} props['configuration'] = 'foo' props['ip'] = '127.0.0.1' props['port'] = '2016' otd_enableStatusListener(props)
-
-
Disabling a status listener
To disable a status listener, run the
otd_disableStatusListener
command, as shown in the example:props = {} props['configuration'] = 'foo' otd_disableStatusListener(props)
-
Viewing properties of status listener properties
To view the status listener properties, run the
otd_getStatusListenerProperties
command, as shown in the example:props = {} props['configuration'] = 'foo' otd_getStatusListenerProperties(props)
-
Changing the SSL properties of status listener
To change the SSL properties of status listener, run the
otd_setStatusListenerSslProperties
command, as shown in the example:To disable SSL on a status listener, set the
enabled
property to false.props = {} props['configuration'] = 'foo' props['enabled'] = 'false' otd_setStatusListenerSslProperties(props)
-
Viewing the status listener SSL properties
To view the SSL properties of a status listener, run the
otd_getStatusListenerSslProperties
command, as shown in the example:props = {} props['configuration'] = 'foo' otd_getStatusListenerSslProperties(props)