blob: 27a2a54afd1fbf3ce45f55b1b1cc8fe078396dbf [file] [log] [blame]
<!--
Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<p><a id="task-networklistenernew" name="task-networklistenernew"></a><a id="GHWEB00039" name="GHWEB00039"></a></p>
<h4><a id="sthref41" name="sthref41"></a>To Create a Network Listener</h4>
<a name="BEGIN" id="BEGIN"></a><a id="sthref42" name="sthref42"></a>
<h5>Before You Begin</h5>
<p>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.</p>
<ol>
<li>
<p>In the navigation tree, expand the Configuration node.</p>
</li>
<li>
<p>Under the Configuration node, expand the Network Config node.</p>
</li>
<li>
<p>Under the Network Config node, select the Network Listeners node.</p>
<p>The Network Listeners page opens.</p>
</li>
<li>
<p>On the Network Listeners page, click New.</p>
<p>The New Network Listener page opens.</p>
</li>
<li>
<p>In the Name field, type a name for the network listener.</p>
<p>A network listener name cannot begin with a number.</p>
</li>
<li>
<p>In the Protocol field, specify the protocol to be associated with the network listener.</p>
<ul>
<li>
<p>Select Create a New Protocol to create a new protocol with default settings. Also, from the Virtual Server drop-down list, select the virtual server to be associated with the protocol.</p>
<p>The default name of the protocol is the name of the network listener with <code>-protocol</code> appended, but you can edit this value.</p>
</li>
<li>
<p>Select Use an Existing Protocol, then select a protocol from the drop-down list. To enable security for the network listener, choose a protocol with security enabled.</p>
<p>If you select this option, you would typically have created the protocol for this listener beforehand.</p>
</li>
</ul>
<p>You can specify the protocol only when you create the network listener. You cannot change the associated protocol later. The protocol determines whether security is enabled for the network listener.</p>
</li>
<li>
<p>Select the Status Enabled checkbox to enable the network listener.</p>
<p>This option is enabled by default. If the listener is disabled, any attempts to connect to the listener result in a socket exception (<code>java.net.ConnectException</code>).</p>
<p>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.</p>
</li>
<li>
<p>The read-only Security Enabled checkbox indicates whether security is enabled for the protocol used by the network listener.</p>
<p>If you are configuring the <code>admin-listener</code> for the domain administration server (DAS), which uses the <code>server-config</code> configuration, this option is read-only. To enable security for this listener, you must enable secure administration. See <a href="../../../common/en/help/ref-securityadmin.html">Secure Administration</a>.</p>
</li>
<li>
<p>Select the JK Listener Enabled checkbox to specify that the listener supports Apache's <code>mod-jk</code> protocol.</p>
<p>The <code>mod-jk</code> protocol is a proprietary communication/network protocol between Apache's <code>httpd</code> (web server) and an GlassFish Server back-end instance. If the listener supports this protocol, <code>httpd</code> is supposed to handle all static content, whereas any requests for dynamic resources (i.e., Servlets and JSPs) are routed to the <code>mod-jk</code> enabled network listener of the GlassFish Server, using the <code>mod-jk</code> protocol. This option is disabled by default.</p>
</li>
<li>
<p>In the Port field, type the port number on which the network listener will listen.</p>
<p>Legal values are 1 through 65535. On a UNIX system, creating sockets that listen on ports 1 through 1024 requires superuser privileges.</p>
</li>
<li>
<p>In the Address field, type the IP address on which the network listener will listen.</p>
<p>The address can be in dotted-pair or IPv6 notation. It can be <code>any</code> (for <code>INADDR_ANY</code>) to listen on all IP addresses. It can be a hostname.</p>
</li>
<li>
<p>From the Thread Pool drop-down list, select the thread pool to be associated with the network listener.</p>
<p>Normally, you select one of the two thread pools that are configured when you install the GlassFish Server.</p>
</li>
<li>
<p>From the Transport drop-down list, select the transport type to be used by the network listener.</p>
<p>By default, the only choice is <code>tcp</code>.</p>
</li>
<li>
<p>Click OK.</p>
</li>
</ol>
<a id="sthref43" name="sthref43"></a>
<h5>Next Steps</h5>
<p>If you enabled security for the protocol used by the network listener, you can use the SSL tab to edit the SSL settings of the protocol.</p>
<a id="sthref44" name="sthref44"></a>
<h5>See Also</h5>
<ul>
<li>
<p><a href="task-networklisteneredit.html">To Edit a Network Listener</a></p>
</li>
<li>
<p><a href="task-networklistenerdelete.html">To Delete a Network Listener</a></p>
</li>
<li>
<p><a href="task-protocolnew.html">To Create a Protocol</a></p>
</li>
<li>
<p><a href="task-protocoledit.html">To Edit a Protocol</a></p>
</li>
<li>
<p><a href="task-protocolssledit.html">To Edit SSL Settings for a Protocol</a></p>
</li>
<li>
<p><a href="task-protocolhttpedit.html">To Edit HTTP Settings for a Protocol</a></p>
</li>
<li>
<p><a href="task-protocolfilecacheedit.html">To Edit File Cache Settings for a Protocol</a></p>
</li>
<li>
<p><a href="task-protocoldelete.html">To Delete a Protocol</a></p>
</li>
<li>
<p><a href="task-transportnew.html">To Create a Transport</a></p>
</li>
<li>
<p><a href="task-transportedit.html">To Edit a Transport</a></p>
</li>
<li>
<p><a href="task-transportdelete.html">To Delete a Transport</a></p>
</li>
<li>
<p><a href="task-virtualservercreate.html">To Create a Virtual Server</a></p>
</li>
</ul>
<small>Copyright &#169; 2005, 2017, Oracle and/or its affiliates. All rights reserved. <a href="docinfo.html">Legal Notices</a></small>