An HTTP connection handler has two dependent configuration objects:

  • One or more HTTP servlet extensions
  • An optional HTTP log publisher.

You must configure the HTTP servlet extension and log publisher before configuring the HTTP connection handler. The log publisher is optional but in most cases, you should configure one or more logs to troubleshoot any issues with your HTTP connection.

  1. To configure your HTTP servlet extensions, run dsconfig with the create-http-servlet-extension option.

    This example uses the ExampleHTTPServletExtension 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"
  2. To configure an HTTP log publisher, run dsconfig with the create-log-publisher option.

    This example configures one log publisher 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"
  3. To configure the HTTP connection handler, run dsconfig with the create-connection-handler option to specify the HTTP servlet extension and log publishers.
    Note:

    Some configuration properties can be updated while the HTTP connection handler is enabled while others, such as listen-port, require that the HTTP connection handler be disabled and then re-enabled for the change to take effect.

    $ 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"
  4. To monitor the connection handler, use the ldapsearch tool.
    Note:

    By default, the HTTP connection handler has an advanced monitor entry property, keep-stats, that is set to TRUE.

    $ bin/ldapsearch --baseDN "cn=monitor" \
      "(objectClass=ds-http-connection-handler-statistics-monitor-entry)"