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.

Note:

You must configure the HTTP servlet extension and log publisher before configuring the HTTP connection handler.

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

    This example uses the ExampleHTTPServletExtension example 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 one or more HTTP log publishers, use the create-log-publisher option with dsconfig.

    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"
  3. To configure the HTTP connection handler, specify the HTTP servlet extension and log publishers using the create-connection-handler option with dsconfig.
    Note:

    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.

    $ 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 by default.

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