Sun GlassFish Enterprise Server v2.1.1 Administration Reference

Attributes

The following table describes attributes for the http-listener element.

Table 1–72 http-listener Attributes

Attribute 

Default 

Description 

id

none 

The unique listener name. An http-listener name cannot begin with a number.

address

none 

IP address of the listener. Can be in dotted-pair or IPv6 notation. Can be any (for INADDR_ANY) to listen on all IP addresses. Can be a hostname.

port

none 

Port number on which the listener listens. Legal values are 1 - 65535. On UNIX, creating sockets that listen on ports 1 - 1024 requires superuser privileges. Configuring an SSL listener to listen on port 443 is standard.

external-port

none 

(optional) Specifies the external port on which the connection is made. 

family

 

(optional) Deprecated. Do not use. 

blocking-enabled

false

(optional) If true, uses a blocking socket for servicing a request.

acceptor-threads

1

(optional) Specifies the number of processors in the machine.  

To set the number of request processing threads, use the thread-count attribute of the request-processing element.

security-enabled

false

(optional) Determines whether the listener runs SSL. To turn SSL2 or SSL3 on or off and set ciphers, use an ssl subelement.

default-virtual-server

none 

References the id attribute of the default virtual-server for this particular listener.

server-name

none 

Tells the server what to put in the host name section of any URLs it sends to the client. This affects URLs the server automatically generates; it doesn’t affect the URLs for directories and files stored in the server. If your server uses an alias, the server-name should be the alias name.

If a colon and port number are appended, that port is used in URLs the server sends to the client. 

If load balancing is enabled, use the server name of the load balancer. 

redirect-port

none 

(optional) If the listener is supporting non-SSL requests and a request is received for which a matching <security-constraint> requires SSL transport, the request is automatically redirected to the port number specified here.

If load balancing is enabled, use the redirect port of the load balancer. 

xpowered-by

true

(optional) If true, X-Powered-By headers are used according to the Servlet 2.4 and JSP 2.0 specifications.

enabled

true

(optional) Determines whether the listener is active. If set to false, any attempts to connect to the listener result in a socket exception (java.net.ConnectException).

In Enterprise 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 Enterprise Server version, set the listener's enabled attribute to true, and set every associated virtual server's state to off. A virtual-server lists its associated listeners in its http-listeners attribute.

type

default

Specifies the listener type for machines with multiple IP addresses that have separate internal and external communication. Allowed values are as follows: 

  • internal — Used strictly for proxying by the load balancer.

  • external — Used only by user agents and not by the load balancer.

  • default — Can be used by user agents or the load balancer.