Configuring an HTTP connection handler
About this task
An HTTP connection handler has two dependent configuration objects:
-
One or more HTTP servlet extensions
-
An HTTP log publisher
The log publisher is optional, but in most cases, you should configure one or more logs to troubleshoot any issues with your HTTP connection.
|
You must configure the HTTP servlet extension and log publisher before configuring the HTTP connection handler. |
Steps
-
To configure your HTTP servlet extensions, use the
create-http-servlet-extensionoption withdsconfig.Example:
This example uses the
ExampleHTTPServletExtensionexample in the Server SDK.$ bin/dsconfig create-http-servlet-extension \ --extension-name "Hello World Servlet" \ --type third-party \ --set "extension-class:com.unboundid.directory.sdk.examples.ExampleHTTPServletExtension" \ --set "extension-argument:path=/" \ --set "extension-argument:name=example-servlet" -
To configure one or more HTTP log publishers, use the
create-log-publisheroption withdsconfig.Example:
This example configures two log publishers: one for common access and one for detailed access. Both log publishers use the default configuration settings for log rotation and retention.
$ bin/dsconfig create-log-publisher \ --publisher-name "HTTP Common Access Logger" \ --type common-log-file-http-operation \ --set enabled:true \ --set log-file:logs/http-common-access \ --set "rotation-policy:24 Hours Time Limit Rotation Policy" \ --set "rotation-policy:Size Limit Rotation Policy" \ --set "retention-policy:File Count Retention Policy" \ --set "retention-policy:Free Disk Space Retention Policy" $ bin/dsconfig create-log-publisher \ --publisher-name "HTTP Detailed Access Logger" \ --type detailed-http-operation \ --set enabled:true \ --set log-file:logs/http-detailed-access \ --set "rotation-policy:24 Hours Time Limit Rotation Policy" \ --set "rotation-policy:Size Limit Rotation Policy" \ --set "retention-policy:File Count Retention Policy" \ --set "retention-policy:Free Disk Space Retention Policy" -
To configure the HTTP connection handler, specify the HTTP servlet extension and log publishers using the
create-connection-handleroption withdsconfig.You can update some configuration properties later as needed, but for others, like
listen-port, you must disable and then re-enable the HTTP Connection Handler for the change to take effect.Example:
$ bin/dsconfig create-connection-handler \ --handler-name "Hello World HTTP Connection Handler" \ --type http \ --set enabled:true \ --set listen-port:8443 \ --set use-ssl:true \ --set "http-servlet-extension:Hello World Servlet" \ --set "http-operation-log-publisher:HTTP Common Access Logger" \ --set "http-operation-log-publisher:HTTP Detailed Access Logger" \ --set "key-manager-provider:JKS" \ --set "trust-manager-provider:JKS" -
To monitor the connection handler, use the
ldapsearchtool.By default, the HTTP connection handler has an advanced monitor entry property,
keep-stats, that is set toTRUEby default.Example:
$ bin/ldapsearch --baseDN "cn=monitor" \ "(objectClass=ds-http-connection-handler-statistics-monitor-entry)"