Some test text!

Search
Hamburger Icon

Web / Guides / Setting up Server

Setting up WebViewer BIM Server

WebViewer BIM Server is a REST server for performing 3D document work.

This server comes packaged as a Docker image available for Linux, MacOS Intel (not in M1) or Windows.

Prerequisites

Setting up Server

Pull latest webviewer bim server image:

docker pull pdftron/webviewer-bim-server:latest

Configuring Server

The BIM server supports both setting configuration through a config file and setting it directly through environment variables. To set configuration through a config file take the following steps:

The configuration file is a JSON file with the following options:

  • license - The server license key
  • temp_directory - The temp directory to use for processing. Defaults to ./sys/tmp
  • log_directory - The log directory to use for server logs. Defaults to ./sys/logs
  • data_directory - The directory to store cached data in. Defaults to ./sys/data
  • log_level - Sets the logging level. Accepts DEBUGINFOTRACEWARN
  • num_threads - The number of concurrent jobs to target. Defaults to number of CPUs detected minus 1.
  • bind_address - The server binding address. Defaults to 0.0.0.0
  • port - The server port. Defaults to 8085
  • max_cache_size - The maximum cache size before forcing cache deletion. Defaults to 90% of the available disk.
  • force_zero_cache- Force cache to constantly be removed. Defaults to false
  • release_mode - Sets HTTP to release mode, defaults to true.
  • request_timeout - Maximum time to wait for an HTTP request result in seconds. Defaults to 10 seconds.
  • job_timeout - Maximum time to wait for a job to complete . Defaults to 10 minutes.
  • use_https - If true, enables HTTPS and uses the HTTPSPort. Defaults to false
  • https_port - HTTPS port, defaults to 443
  • https_cert_file - The HTTPS public certificate location.
  • https_key_file - The HTTPS private certificate location.
  • allowed_origins - The origins allowed to access the server. Expects a string array ['test.com','pdftron.com']
  • allow_credentials - If true, includes the Access-Control-Allow-Credentials header in server responses. Required if using withCredentials on client-side API calls.

A sample of what the json file should look like.

{
   "license": "my_license_key",
   "allowed_origins": ["test.com", "pdftron.com"],
   "request_timeout": 30
}

In order to pass these arguments as enviroment variables, just run the docker contianer with variable with the prefix trn_, such as:

docker run -e trn_license="MYLICENSE" -p 8085:8085 pdftron/webviewer-bim-server

Running Server

Running with Docker and configuration file

docker run -p 8085:8085 -v ABSOLUTE_PATH_TO_CONFIG_JSON_FILE:/home/docjob/config pdftron/webviewer-bim-server
Replace ABSOLUTE_PATH_TO_CONFIG_JSON_FILE with the path of your config.json file.

This will mount the config file to the container into the path /home/docjob/config where it will be loaded from.

Running with Docker and environment variables

docker run -p 8085:8085 -e trn_license="my_license_key" pdftron/webviewer-bim-server
Replace trn_license with the license that Apryse provides.

This will run the container with the trn_license configuration variable defined.

Managing Docker

It's important to maintain uptime when using a Docker container. The best way to do this is with a container management tool such as Portainer, Kubernetes, OpenShift, Docker, ECS and much more.

When managing your container, you can use the built-in health API to monitor its status.

Include credentials in cross-origin BIM requests

If you enabled withCredentials in supported client-side APIs, the BIM server must be configured correctly:

  1. Ensure allow_credentials is enabled.
  2. Ensure allowed_origins is not using the default * wildcard.

See client-side documentation for more details.

Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales