Basic Structure

WebtoB environment configuration is set for the operation of a WebtoB node and the web server.

WebtoB’s environment configuration file supports YAML and JSON formats. It consists of 'section name', 'item name', and 'setting value'.

The following is the configuration format in JSON.

"Section Name": {
  "Item" : Setting Value,
  ...,
  "Item" : Setting Value
}

The start of each section is followed by the section name and then configuration items.

Configuration must be set according to the rules of JSON or YAML format, depending on the chosen format.

 

The following is an example of configuration in JSON format.

{
  "node": {
    "name": "webtob_node",
    "hth_count": 1,
    "worker_threads": 8
  },
  "server": {
    "http": {
      "common_config": {
        "doc_root": "docs",
        "access_log": "access_log1"
      },
      "http_servers": [
        {
          "name": "http1",
          "port": 8080,
          "enable_ssl": true,
          "ssl_name": [
            "ssl1"
          ]
        }
      ]
    },
    "wjp": {
      "port": 9900,
      "wjp_servers": [
        {
          "name": "MyGroup1"
        }
      ]
    }
  },
  "logging": {
    "access_log": [
      {
        "name": "access_log1",
        "level": "INFO",
        "format": "DEFAULT",
        "handlers": {
          "file_handler": {
            "file_name": "logs/access.log"
          }
        }
      }
    ],
    "error_log": {
      "level": "INFO",
      "handlers": {
        "file_handler": {
          "file_name": "logs/errors.log"
        }
      }
    },
    "system_log": [
      {
        "name": "webtob",
        "level": "INFO",
        "handlers": {
          "file_handler": {
            "file_name": "logs/webtob.log"
        }
      }
    ]
  },
  "destination": {
    "jeus": [
      {
        "name": "MyGroup1"
      }
    ],
    "reverse_proxy": {
      "reverse_proxy_group": [
      {
        "name": "rproxyg1",
        "reverse_proxy_server": [
          {
            "address": "internal.server:80",
            "name": "rproxy1"
          }
        ]
      }
    ]},
    "htmls": [
      {
        "name": "htmls1"
      }
    ]
  },
  "service": {
    "uri": [
      {
        "name": "uri1",
        "target_http_servers": [
          "http1"
        ],
        "match": {
          "type": "prefix",
          "target": "/rproxy",
          "rewrite": "/"
        },
        "destination": {
          "type": "REVERSE_PROXY",
          "target": "rproxyGroup1"
        }
      }
    ],
    "ext": [
      {
        "name": "ext1",
        "target_http_servers": [
          "*"
        ],
        "match": {
          "type": "exact",
          "target": "text/html"
        },
        "destination": {
          "type": "JEUS",
          "target": "MyGroup1"
        }
      }
    ]
  },
  "ssl": {
    "ssl_configs": [
      {
        "name": "ssl1",
        "certificate_file": "server.crt",
        "certificate_key_file": "key.crt"
      }
    ]
  }
}

Types of Configurable Sections

The following describes each section that can be configured in WebtoB.

Section Description

ACCESS

Client access control based on IP address, network/netmask, and header information.

ALIAS

Alias for the physical server path and URI.

DESTINATION

The internal server that will actually handle client requests.

ERRORDOCUMENT

Error response actions.

FILTER

Section for using the Filter module.

HEADERS

Settings for controlling HTTP request and response headers.

LOGGING

Logging format for client requests.

NODE

Node settings.

SERVER

Settings for the information that clients can access.

SERVICE

Settings for internal server to handle HTTP requests based on the request’s URI and EXT.

SSL

SSL to use on WebtoB.

The DESTINATION, SERVER, and SERVICE sections are required.

Types of Setting Values and Configuration Methods

The values of each item are set in one of the following types: object, integer, string, boolean, or array. The following describes each value type.

Type Description

object

Used when there are multiple child settings.

  • JSON: Enclosed with curly braces ({ })

  • YAML: Indent one level after a line break

integer

Numeric values.

string

String values.

boolean

Sets to either true or false.

array

Sets multiple settings of the same type. Enclose with square brackets ([ ]) and separate each setting with a comma (,), or use hyphen (-) after a line break.

To fully understand the configuration items described in this guide, you must first be familiar with the basic rules as follows:

  • An item starting with the hash symbol (#) before its name is an optional item.

  • If a format is enclosed in square brackets ([ ]), it indicates an array format composed of specific types.

  • If a default value exists, specify the value after the hash symbol.

  • For a integer variable, use parentheses to display the valid range.

  • If the maximum limit does not exist, omit the range. The maximum value must be less than or equal to INT_MAX (2147483647).

  • "$ENV" means the environment variable can be referenced.

  • "R.PATH" means that a relative path, if specified, is relative to $WEBTOB6_HOME_PATH.

  • For object format, internal settings are expressed in curly brackets ( { } ).

  • For object format, if the same format exists in a parent setting, the description is omitted with "{…​}".

  • "COMMON" indicates that if not specified, it follows the parent setting.