webserver.js Setup
Set up webserver.js as the web server backend for your WinCC OA project, including the manager entry and basic configuration.
Before setting up webserver.js, ensure the following prerequisites are met:
- A WinCC OA installation (version 3.21 or later) with the setup component Environment for JavaScript installed.
- The WinCC OA JavaScript Manager for Node.js is available.
- Valid SSL certificates for HTTPS connections (see SSL Certificates).
webserver.js serves as a backend for the WinCC OA Dashboard and web applications. The following sections describe how to add the manager entry and configure the server for your project.
- Open the WinCC OA Console.
-
Add a JavaScript Manager to your project.
In the Console, add a new manager with the following settings:
- Manager type:
node - Script:
webserver-js/run.js
Additional parameters must be placed before the script path. For example:
-num 4 webserver-js/run.js - Manager type:
-
Configure the
[webserverjs]section in your project configuration file.Add a
[webserverjs]section to your project config file. The default HTTPS port is8443. To use a different port, specify it explicitly:[webserverjs] httpsPort = 8443The default port is
8443. This port is different from the default port ofwebclient_http.ctl, so both can run in parallel without port conflicts. -
Start the JavaScript Manager.
Start or restart the manager from the Console. Once running, access the Dashboard by navigating to
https://<hostname>:8443in a web browser.
webserver.js is now running and serving the WinCC OA Dashboard. You can verify by opening the configured URL in a web browser.
Migration from Older Components
If you are migrating from an existing dashboard.ctl or HTTP Server
setup, note the following changes:
| Setting | dashboard.ctl (old) | webserver.js (new) |
|---|---|---|
| Manager type | WCCOActrl |
node |
| Script | dashboard.ctl |
webserver-js/run.js |
| Config section (WSS) | [wssServer] |
[webserverjs] |
| Config section (Dashboard) | [httpServer] |
[webserverjs] |
| Default port | 8448 |
8443 |
| Parameter position | After script name | Before script path |
The following example shows the required changes in the config/progs file.
Before (dashboard.ctl):
WCCOActrl | always | 30 | 3 | 1 |webclient_http.ctl -num 2
WCCOActrl | always | 30 | 3 | 1 |dashboard.ctl
After (webserver.js):
WCCOActrl | always | 30 | 3 | 1 |webclient_http.ctl -num 2
node | always | 30 | 3 | 1 |webserver-js/run.js
webclient_http.ctl is still required
for ULC UX forwarding and
other purposes not covered by webserver.js. Do not remove it. It is possible to
run both managers in parallel as long as they use different port numbers.