To Create a Network Listener

Before You Begin

When you create a network listener, you can simultaneously create a protocol that the network listener will use, or use a protocol that you create first. Typically, there is a one-to-one relationship between a network listener and its associated protocol, but this is not required.

  1. In the navigation tree, expand the Configuration node.
  2. Under the Configuration node, expand the Network Config node.
  3. Under the Network Config node, select the Network Listeners node.

    The Network Listeners page opens.

  4. On the Network Listeners page, click New.

    The New Network Listener page opens.

  5. In the Name field, type a name for the network listener.

    A network listener name cannot begin with a number.

  6. In the Protocol field, specify the protocol to be associated with the network listener.

    You can specify the protocol only when you create the network listener. You cannot change the associated protocol later.

  7. Select the Status Enabled checkbox to enable the network listener.

    This option is enabled by default. If the listener is disabled, any attempts to connect to the listener result in a socket exception (java.net.ConnectException).

    In GlassFish Server versions prior to 9.1, a listener whose enabled attribute was set to false returned a 404 response code for any requests sent to it. To achieve this behavior in the current GlassFish Server version, set the listener's status to enabled, and set every associated virtual server's state to OFF. A virtual server lists its associated listeners in its Network Listeners drop-down list.

  8. Select the Security Enabled checkbox to enable security for the protocol used by the network listener.

    This option is disabled by default.

  9. Select the JK Listener Enabled checkbox to specify that the listener supports Apache's mod-jk protocol.

    The mod-jk protocol is a proprietary communication/network protocol between Apache's httpd (web server) and an GlassFish Server back-end instance. If the listener supports this protocol, httpd is supposed to handle all static content, whereas any requests for dynamic resources (i.e., Servlets and JSPs) are routed to the mod-jk enabled network listener of the GlassFish Server, using the mod-jk protocol. This option is disabled by default.

  10. In the Port field, type the port number on which the network listener will listen.

    Legal values are 1 through 65535. On a UNIX system, creating sockets that listen on ports 1 through 1024 requires superuser privileges.

  11. In the Address field, type the IP address on which the network listener will listen.

    The address can be in dotted-pair or IPv6 notation. It can be any (for INADDR_ANY) to listen on all IP addresses. It can be a hostname.

  12. From the Thread Pool drop-down list, select the thread pool to be associated with the network listener.

    Normally, you select one of the two thread pools that are configured when you install the GlassFish Server.

  13. From the Transport drop-down list, select the transport type to be used by the network listener.

    By default, the only choice is tcp.

  14. Click OK.

Next Steps

If you enabled security for the network listener, you can use the SSL tab to edit the SSL settings of the protocol used by the network listener.

See Also

Copyright © 2005, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices