Startup and Shutdown

To check if WebtoB is operating properly after installation, a simple test startup is performed.

For more information about starting and shutting down WebtoB, refer to WebtoB Administrator’s Guide.

Creating the Configuration File

To start WebtoB, the configuration file must be created. The configuration file is set using the webtob-config.json file, which is provided by default in the ${WEBTOB6_HOME_PATH}/config directory.

The following is an example of the webtob-config.json file.

---
{
  "node": {
    "name": "tmaxsoft",
    "hth_count": 1,
    "worker_threads": 8,
    "hth_schedule": "RR"
  },
  "server": {
    "http": {
      "mime_type_file": "mime.types",
      "common_config": {
        "doc_root": "docs",
        "service_order": "uri,ext",
        "access_log": "access_log1",
        "enable_keepalive": true,
        "keepalive_timeout": 60
      },
      "http_servers": [
        {
          "name": "http1",
          "idle_timeout": 300,
          "port": 8080,
          "enable_ssl": false
        }
      ]
    },
    "wjp": {
      "port": 9900,
      "wjp_servers": [
        {
          "name": "MyGroup1",
          "svr_chk_time": 60
        }
      ]
    },
   "admin": {
      "port": 9090
    }
  },
  "logging": {
    "access_log": [
      {
        "name": "access_log1",
        "level": "INFO",
        "format": "DEFAULT",
        "handlers": {
          "file_handler": {
            "file_name": "access.log"
          },
        "enable_console_handler": false
        }
      }
    ],
    "error_log": {
      "level": "INFO",
      "handlers": {
        "file_handler": {
          "file_name": "errors.log"
        },
        "enable_console_handler": false
      }
    },
    "system_log": [
      {
        "name": "webtob",
        "level": "INFO",
        "handlers": {
          "file_handler": {
            "file_name": "webtob.log"
          },
          "enable_console_handler": false
        }
      }
    ]
  },
  "destination": {
    "jeus": [
      {
        "name": "MyGroup1",
        "server_schedule": "RR",
        "connection_schedule": "RR"
      }
    ],
    "reverse_proxy": {
      "reverse_proxy_group": [
        {
          "name": "rproxyGroup1",
          "reverse_proxy_server": [
            {
              "address": "internal.server:8888",
              "name": "rproxy1",
              "enable_proxy_ssl": false
            }
          ]
        }
      ]
    },
    "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"
        }
      }
    ]
  }
}

The following are the items that must be modified when creating the webtob-config.json file:

Item Description

server > http > http_servers > port

Specifies the port to be used by the HTTP server.

server > wjp > port

Specifies the port to be used by the WJP server.

When setting the port numbers for the HTTP and WJP servers, specify a unique number, as WebtoB may not start if the port is already in use.

Starting Up WebtoB

The following describes the process for starting WebtoB.

  1. Go to the ${WEBTOB6_HOME_PATH}/bin directory and run the wsboot.sh command.

    $ wsboot.sh
    Booting WebtoB on node (tmax)
    Current maximum open files per node 65535
    Version: WEBTOB 6.0 Fix #0
             Environment variables for WebtoB boot:
                    WEBTOB6_HOME_PATH = /home/webtob/
                    WEBTOB6_CONFIG_FILE_PATH = /home/webto/config/
                    WEBTOB6_LIBRARY_PATH = /home/webtob/lib/
                    WEBTOB6_SSL_PATH = /home/webtob/ssl/
                    WEBTOB6_LICENSE_PATH = /home/webtob/license/
                    WEBTOB6_SCHEMA_PATH = /home/webtob/schema/
                    WEBTOB6_LOG_PATH = /home/webtob/log/
                    WEBTOB6_CONFIG_FILE_NAME = webtob-config.json
    
    Welcome to WebtoB Demo system.
    Enterprise edition License in used.
    Schema file path: /home/webtob/schema/webtob-config-enterprise.schema.json
    
    ******* Start config validation *******
    1. Opened schema file
    2. Opened config file
    3. Config parsing finished
    4. Pre-validation process finished
    5. Validation using json-schema finished
    6. Post-validation process finished
    7. Environment-validation process finished
    Config file "/home/webtob/config/webtob-config.json" is validated with schema file "/home/webtob/schema/webtob-config-enterprise.schema.json"
    Success to load config files : webtob-config.json
    ******* Validation success *******
             Current WebtoB Configuration:
                    Number of client handlers (HTH) = 1
                    Number of worker threads per handler (HTH) = 8
                    Number of connection pool size per handler (HTH) = 8192
    
    Today is 2024-10-07
    License expires on 2024-11-29 (53 days remaining)
    Starting Server(pid:17611) at Mon Oct  7 12:04:18 2024
    Successfully started the server. The server state is now RUNNING.
  2. After WebtoB starts, request services through a browser. Be sure to include "index.html" in the request.

    http://<IP address>:<port number>/index.html
  3. If WebtoB has successfully started, the following page appears.

    figure 3 1

Shutting Down WebtoB

To shut down WebtoB, run the wsdown command. Before shutting down, check the .webtob.pid file to verify if WebtoB is currently running. Then, go to the ${WEBTOB6_HOME_PATH}/bin directory and execute the wsdown command.

The following is an example of running the wsdown command to shut down WebtoB.

$ wsdown
wsdown: Shutting down Webtob.
wsdown: Webtob(pid: 17611) is terminated.