Setting Up Web Forms via HTTPS

If the web application works via the HTTPS protocol, an additional setting will be required for correct work of web forms using the WebSocket protocol, to ensure that encrypted WSS connection is used.

  1. Add the following strings to the settings file /etc/apache2-fp10.x-web/sites-available/webserver.conf:

<VirtualHost *:9091>

ProxyPass /service ws://localhost:${WEBFORMS_PORT}/service

ProxyPassReverse /service ws://localhost:${WEBFORMS_PORT}/service

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/cert.crt

SSLCertificateKeyFile /etc/apache2/ssl/cert.key

SSLProxyEngine On

RewriteEngine On

RewriteCond %{HTTP:Connection} upgrade [NC]

RewriteCond %{HTTP:Upgrade} websocket [NC]

RewriteRule ^(.*) ws://localhost:${WEBFORMS_PORT}/$1 [P,L]

</VirtualHost>

where cert.crt, cert.key - files of previously generated and installed security certificate. A security certificate can be prepared using special cryptographic software, for example, OpenSSL. The installation example is given in the Setting Up Two-Factor Authentication subsection.

9091 - default port used for web form work.

  1. Add the following string at the end of the variable file /etc/apache2-fp10.x-web/envvars:

export WEBFORMS_PORT=9093

where 9093 is the port that will be determined on BI server in the 5 point.

  1. In the /etc/apache2-fp10.x-web/ports.conf file add the 9091 port for listening, to which client requests will be sent:

<IfModule ssl_module>

Listen 443

Listen 9091

</IfModule>

  1. Install the proxy_http and proxy_wstunnel modules:

sudo a2enmod-fp10.x-web proxy_http proxy_wstunnel

  1. In the settings.xml BI server settings file determine the web form port for working via the WebSocket protocol:

<Configuration>

  <Root>

    <Key Name="PP">

      <BIS>

        <Key Name="System">

          <WebForms Port="9093"/>

        </Key>

      </BIS>

    </Key>

  </Root>

</Configuration>

One can set an alternative setting option as follows:

  1. Add the following strings to the settings file /etc/apache2-fp10.x-web/sites-available/webserver.conf:

<VirtualHost *:9093>

ProxyPass /service ws://localhost:${WEBFORMS_PORT}/service

ProxyPassReverse /service ws://localhost:${WEBFORMS_PORT}/service

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/cert.crt

SSLCertificateKeyFile /etc/apache2/ssl/cert.key

SSLProxyEngine On

RewriteEngine On

RewriteCond %{HTTP:Connection} upgrade [NC]

RewriteCond %{HTTP:Upgrade} websocket [NC]

RewriteRule ^(.*) ws://localhost:${WEBFORMS_PORT}/$1 [P,L]

</VirtualHost>

  1. Add the following string at the end of the variable file /etc/apache2-fp10.x-web/envvars:

export WEBFORMS_PORT=9091

  1. In the file /etc/apache2-fp10.x-web/ports.conf add the 9093 port for listening, to which client requests will be sent:

<IfModule ssl_module>

Listen 443

Listen 9093

</IfModule>

  1. In the config.json web application settings file specify the port, on which web forms will work:

{
  ...
  "webSocketPort": "9093",
  ...
}

See also:

Web Application Back End