15.3. Servlet/HTTP Configuration

Procedure 15.3. Servlet/HTTP Configuration

  1. In the Management Console, click the Configuration tab at the top of the screen, expand the Subsystems menu and then expand the Web menu.
  2. Click on the Servlet/HTTP menu item.
  3. Click on the name of the component, then click on Edit.
  4. Click the Advanced button to view advanced options.
Following are the advanced Servlet/HTTP configuration options.
If the Management CLI commands are to be applied to a profile, add the prefix /profile=PROFILE.

Example 15.1. Configure the Name of this Instance

[domain@localhost:9999 /] /profile=full-ha/subsystem=web:write-attribute(name=instance-id,value=worker1)

Global Configuration Options

Default Session Timeout
Available from JBoss EAP 6.4. The web container's default session timeout.
Management CLI attribute: default-session-timeout
Default Virtual Server
The web container's default virtual server.
Management CLI attribute: default-virtual-server
Instance ID
The identifier used to enable session affinity in load balancing scenarios. The identifier must be unique across all JBoss EAP servers in the cluster and is appended to the generated session identifier. This allows the front-end proxy to forward the specific session to the same JBoss EAP instance. The instance ID is not set as a default.
Management CLI attribute: instance-id
Native
Add the native initialization listener to the web container.
Management CLI attribute: native. Values: true or false. Default: true.

JSP Configuration Options

Check Interval
Interval at which to check for JSP updates using a background thread, specified in seconds. Default: 0, which means disabled.
Management CLI attribute: check-interval
Development
If true, enables Development Mode, which produces more verbose debugging information. Default: false.
Management CLI attribute: development
Disabled
If true, the Java ServerPages (JSP) container is disabled. This is useful if you do not use any JSPs. Default: false.
Management CLI attribute: disabled
Display Source Fragment
If true, the JSP source fragment is displayed when a runtime error occurs. Default: true.
Management CLI attribute: display-source-fragment
Dump SMAP
If true, JSR 045 SMAP data is written to a file. Default: false
Management CLI attribute: dump-smap
Generate Strings as Char Arrays
If true, string constants are generated as char arrays. Default: false
Management CLI attribute: generate-strings-as-char-arrays
Error on Use Bean Invalid Class Attribute
If true, enables the output of errors when a bad class is used in useBean. Default: false
Management CLI attribute: error-on-use-bean-invalid-class-attribute
Java Encoding
Specifies the encoding used for Java sources. Default: UTF8
Management CLI attribute: java-encoding
Keep Generated
If true, keeps generated Servlets. Default: true.
Management CLI attribute: keep-generated
Mapped File
If true, static content is generated with one print statement per input line, to ease debugging. Default: true.
Management CLI attribute: true
Modification Test Interval
Minimum amount of time between two tests for updates, specified in seconds. Default: 4
Management CLI attribute: modification-test-interval
Recompile on Fail
If true, failed JSP compilations will be retried on each request. Default: false.
Management CLI attribute: recompile-on-fail
Scratch Directory
Specifies the location of a different work directory.
Management CLI attribute: scratch-dir
SMAP
If true, JSR 045 SMAP is enabled. Default: true
Management CLI attribute: smap
Source VM
Java development kit version with which the source files are compatible. Default: 1.5
Management CLI attribute: source-vm
Tag Pooling
If true, tag pooling is enabled. Default: true
Management CLI attribute: tag-pooling
Target VM
Java development kit version with which the class files are compatible. Default: 1.5
Management CLI attribute: target-vm
Trim Spaces
Trim some spaces from the generated Servlet. Default: false.
Management CLI attribute: trim-spaces
X Powered By
If true, the JSP engine is advertised using the x-powered-by HTTP header. Default: true.
Management CLI attribute: x-powered-by
Use one of the following commands to view the settings for either of these connectors:
[standalone@localhost:9999 /] /subsystem=web/connector=http:read-resource-description
[standalone@localhost:9999 /] /subsystem=web/connector=ajp:read-resource-description
To configure a connector, select the Connectors tab and click Add. To remove a connector, select its entry and click Remove. To edit a connector, select its entry and click Edit.
When you create a new connector using the Management CLI, its options are all set at once, as in the following command:

Example 15.2. Create a New Connector

[domain@localhost:9999 /] /profile=full-ha/subsystem=web/connector=ajp/:add(socket-binding=ajp,scheme=http,protocol=AJP/1.3,secure=false,name=ajp,max-post-size=2097152,enabled=true,enable-lookups=false,redirect-port=8433,max-save-post-size=4096)

Default Connector attributes

Bytes Sent
The number of byte sent by the connector.
Management CLI attribute: bytesSent
Proxy Port
The port that will be used when sending a redirect.
Management CLI attribute: proxy-port
Secure
Indicates if content sent or received by the connector is secured from the user perspective. Default: false.
Management CLI attribute: secure
Virtual Server
The list of virtual servers that can be accessed through this connector. Default: Allow all virtual servers.
Management CLI attribute: virtual-server
Error Count
Number of errors that occur when processing requests by the connector.
Management CLI attribute: errorCount
Maximum Time
Maximum time spent to process a request.
Management CLI attribute: maxTime
Socket Binding
The named socket binding to which the connector is to be bound. A socket binding is a mapping between a socket name and a network port. Socket bindings are configured for each standalone server, or via socket binding groups in a managed domain. A socket binding group is applied to a server group.
Management CLI attribute: socket-binding
Scheme
The web connector scheme (such as HTTP or HTTPS).
Management CLI attribute: scheme
Name
A unique name for the connector.
Management CLI attribute: name
Maximum Post Size
Maximum size in bytes of a POST request that can be parsed by the container. Default: 2097152
Management CLI attribute: max-post-size
Request Count
Number of the request processed by the connector.
Management CLI attribute: requestCount
Proxy Name
The host name that will be used when sending a redirect. Default: null.
Management CLI attribute: proxy-name
Enabled
Defines whether the connector is started on startup. Default: true
Management CLI attribute: enabled
Protocol
The web connector protocol to use, either AJP or HTTP. For each protocol you can either specify the API and leave it to the server to determine which implementation is used, or specify the fully-qualified class name.
Management CLI attribute: protocol

HTTP
API options: HTTP/1.1 or HTTP/1.0.
If the client does not support HTTP/1.1, the connector will return HTTP/1.1 in its initial response, then fall back to HTTP/1.0.

Fully Qualified Connector Name options:

  • JIO: org.apache.coyote.http11.Http11Protocol
  • NIO2: org.apache.coyote.http11.Http11NioProtocol
  • APR: org.apache.coyote.http11.Http11AprProtocol
AJP
API option: AJP/1.3

Fully Qualified Connector Name options:

  • JIO: org.apache.coyote.ajp.AjpProtocol
  • APR: org.apache.coyote.ajp.AjpAprProtocol

Note

APR requires the Native Components package be installed and active. For detailed instructions on how to do so, see the JBoss EAP Installation Guide.
Enable Lookups
Enable DNS lookups for the Servlet API.
Management CLI attribute: enable-lookups
Executor
The name of the executor that should be used for the processing threads of this connector. If undefined defaults to using an internal pool.
Management CLI attribute: executor
Processing Time
Processing time used by the connector, measured in milliseconds.
Management CLI attribute: processingTime
Proxy Binding
The socket binding to define the host and port that will be used when sending a redirect. Default: null.
Management CLI attribute: proxy-binding
Redirect Port
The port for redirection to a secure connector. Default: 443
Defers to redirect-binding when set concurrently.
Management CLI attribute: redirect-port
Bytes Received
Number of bytes received by the connector (POST data).
Management CLI attribute: bytesReceived
Redirect Binding
Redirect binding is similar to redirect port in terms of behavior except that it requires specification of a socket-binding name in value instead of a port number. The redirect-binding option provides higher configuration flexibility because it allows the use of pre-defined socket binding (https, AJP etc.) to the specific port for redirection. It gives the same results as redirect-port option.
Takes precedence over redirect-port when set concurrently.
Management CLI attribute: redirect-binding
Maximum Connections
The maximum number of concurrent connections that can be processed by the connector with optimum performance. The default value depends on the connector used.
Management CLI attribute: max-connections
Maximum Save Post Size
Maximum size in bytes of a POST request that will be saved during certain authentication schemes. Default: 4096.
Management CLI attribute: max-save-post-size
To configure virtual servers, click the Virtual Servers tab. Use the Add button to add a new virtual server. To edit or remove a virtual server, select its entry and click the Edit or Remove button.
When you add a new virtual server using the Management CLI, all required options are set at once, as in the following command.

Example 15.3. Add a New Virtual Server

/profile=full-ha/subsystem=web/virtual-server=default-host/:add(enable-welcome-root=true,default-web-module=ROOT.war,alias=["localhost","example.com"],name=default-host)

Virtual Servers Options

Access Log
The element describing how the access log information must be logged.
Management CLI attribute: access-log
  • To add access-log attribute enter the following management CLI command:
    /subsystem=web/virtual-server=default-host/configuration=access-log:add()
  • The access-log attribute has several child attributes. To list these children and their configuration options, enter the following management CLI command:
    /subsystem=web/virtual-server=default-host/configuration=access-log:read-resource-description()
    pattern
    A formatting layout identifying the various information fields from the request and response to be logged, or the word common or combined to select a standard format. Values for the pattern attribute are made up of format tokens. If not specified, a default of common is used.
    rotate
    Tell the valve if it should rotate the ouput or not. If not specified, a default of true is used.
    prefix
    Define the prefix to be used to name the log file. If not specified, a default of access_log is used.
    extended
    Uses the ExtendedAccessLogValve instead the AccessLogValve. If not specified, a default of false is used.
    resolve-hosts
    Tell the valve whether to resolve the host names or not. If not specified, a default of false is used. Unless the lookups on the connector for resolve-host is enabled, this option will not work. This can be enabled by setting resolve-host to true.
Alias
A list of hostnames supported by this virtual server. In the Management Console, use one hostname per line.
Management CLI attribute: alias
Default Web Module
The module whose web application will be deployed at the root node of this virtual server, and will be displayed when no directory is given in the HTTP request. Default: ROOT.war
Management CLI attribute: default-web-module
Enable Welcome Root
This element defines whether or not the bundled welcome directory is used as the root web context. Default: false
Management CLI attribute: enable-welcome-root
Name
A unique name for the virtual server, for display purposes.
Management CLI attribute: name
Rewrite
The element describing what the rewrite valve must do with requests corresponding to the virtual host. rewrite describes how requests would be rewritten before processing. It adds the RewriteValve to the Virtual Host defined by virtual-server.
flag
A RewriteRule can have its behavior modified by one or more flags. Flags are included in square brackets at the end of the rule, and multiple flags are separated by commas.
pattern
Pattern is a perl compatible regular expression, which is applied to the URL of the request.
substitution
The substitution of a rewrite rule is the string which is substituted for (or replaces) the original URL which Pattern matched.
Management CLI attribute: rewrite
SSO
SSO configuration for this virtual server. Default (in case of http): true.
Management CLI attribute: sso
  • To add SSO configuration, enter the following management CLI command:
    /subsystem=web/virtual-server=default-host/configuration=sso:add()
  • The SSO attribute has several child attributes. To list these children and their configuration options, enter the following management CLI command:
    /subsystem=web/virtual-server=default-host/configuration=sso:read-resource-description()
    http-only
    The cookie http-only flag will be set.
    cache-container
    Enables clustered SSO using the specified clustered cache container.
    reauthenticate
    Enables reauthentication with the realm when using SSO.
    domain
    The cookie domain that will be used.
    cache-name
    Name of the cache to use in the cache container.