Přeskočit obsah

Installing an HTML5 Gateway on a dedicated Debian server

This variant installs the HTML5 Gateway alone on its own Debian server (IP_HTML5_GW), without the Edge Gateway components. Placed in the LAN, the server is reached by the Mediation Controller through an Edge Gateway that can connect to it on TCP port 8080; placed in the DMZ, it receives the connection of the Mediation Controller directly (see Placements). The prerequisites of the server are described in Prerequisites of the HTML5 Gateway.

Note

As a reminder, switching to root on Debian machines must be done with the following command:

1
su -

Values used on this page

The following values are used in several commands and configuration files of this page. Enter them here: the commands displayed on this page are updated as you type.
A value used by a single command is entered in a table placed just before that command.

Value Variable Definition
IP_GW IP address of the Edge Gateway server.
HTML5_CERT_FILE Name of the certificate file of the HTML5 Gateway.
URL_HTML5 Content of the URL field of the HTML5 Gateway declared in the administration console (for example HTML5-2).
GW_NAME Name of the Edge Gateway through which the Mediation Controller reaches the HTML5 Gateway; the | character at the end of the line must be kept.
ORGANIZATION_NAME Name of the organisation to which the Edge Gateways connect.
IP_HTML5_GW Address of the HTML5 Gateway server, as reached from the Edge Gateway or, in the DMZ, from the Mediation Controller.

Downloading the mirror and necessary tools

The CyberElements Bastion 4.7 mirror and the Systancia repository signature key for Debian 13 can be downloaded from this link (requires the creation of a client account): Systancia Marketplace

In addition to the mirror and key, third-party tools will be required for the installation process:

  • An SSH client (on Windows, you can use PuTTY)
  • An SCP client (on Windows, the WinSCP or FileZilla tools can be used)

Use the SSH client to connect remotely to your server.

Use the SCP client to transfer files to your remote machine.

Preparing for installation

Configuration of the network

The network of the server is prepared as for an Edge Gateway; IP_GW then designates the address of the HTML5 Gateway server (IP_HTML5_GW).

It is highly recommended to define a static network address for the Edge Gateway server. To do this, you first need to retrieve the name of your machine's network interface and its MAC address. Run the following command as root:

1
ip -br link | grep -ve "^lo"

This command displays the name of the network interface, its status, its MAC address, and the interface settings.

Example

After the command is executed, the following output is displayed:

1
ens192           UP             00:50:56:a1:56:9f <BROADCAST,MULTICAST,UP,LOWER_UP>

The name of the network interface is ens192 and its MAC address is 00:50:56:a1:56:9f.

Once the network interface name and MAC address have been obtained, it is now possible to edit the machine's network configuration.
Edit the /etc/network/interfaces file to modify it using the following template:

Value Variable Definition
INTERFACE_NAME Name of the network interface, retrieved with the previous command.
MAC_ADDRESS MAC address of the network interface, retrieved with the previous command.
NETMASK Network mask associated with the IP addresses.
NETWORK_GATEWAY Default network gateway.
IP_DNS_1 IP address of the DNS server.
IP_DNS_2 IP address of a second DNS server (optional: left empty, it disappears from the configuration).
DNS_SUFFIX DNS suffix to use; without a suffix, delete the dns-search line.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br0
iface br0 inet static
    bridge_ports INTERFACE_NAME
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 2
    bridge_hw MAC_ADDRESS
    address IP_GW
    netmask NETMASK
    gateway NETWORK_GATEWAY
    dns-nameservers IP_DNS_1 IP_DNS_2
    dns-search DNS_SUFFIX
Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br0
iface br0 inet static
    bridge_ports ens192
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 2
    bridge_hw 00:50:56:a1:56:9f
    address 172.16.10.10
    netmask 255.255.255.0
    gateway 172.16.10.254
    dns-nameservers 172.16.11.2 172.16.11.3
    dns-search domain.local

Before applying the configuration, there are three more steps to complete.

The first is to install packages resolvconf and bridge-utils so that the DNS configuration specified in the previous file can be applied and the br0 interface can be used:

1
apt install -y resolvconf bridge-utils

The second is to check the configuration of the /etc/hosts file with regard to the machine's primary IP address (IP_GW).
To do this, edit the /etc/hosts file: after the Debian installation, its second line holds the address 127.0.1.1 followed by the machine name. Replace this address with IP_GW, so that the second line is in the following format:

Value Variable Definition
FQDN Fully qualified name of the machine (name and domain); without a domain, delete it from the line.
MACHINE_NAME Short name of the machine.
2
IP_GW   FQDN    MACHINE_NAME
Example

If the machine is named EDGE-GATEWAY without belonging to a domain and its IP address IP_GW is 172.16.10.10, then the file would be completed as follows:

2
172.16.10.10  EDGE-GATEWAY

If the machine belongs to the DOMAIN.LOCAL domain, then the file would be completed as follows:

2
172.16.10.10  EDGE-GATEWAY.DOMAIN.LOCAL   EDGE-GATEWAY

Attention!

An incorrect configuration of the file may cause an error when installing the collectd package.

All that remains is to restart the server:

1
reboot

Configuring the APT package manager

Upload the files downloaded from the Systancia Marketplace to the /tmp/ directory on the server using an SCP client:

  • systancia.gpg
  • cleanroom-4.7.0-build75.1097.D13-full_auto.tgz

Log in to the server as root, then run the following commands to unzip the Systancia repository, configure its use in APT, and authenticate it.

1
2
3
4
5
6
mv /tmp/systancia.gpg /etc/apt/trusted.gpg.d/
mkdir -p /opt/systancia/repository/
tar xvzf /tmp/cleanroom-4.7.0-build75.1097.D13-full_auto.tgz -C /opt/systancia/repository/
rm /tmp/cleanroom-4.7.0-build75.1097.D13-full_auto.tgz
echo "deb file:///opt/systancia/repository/ trixie ipdiva" > /etc/apt/sources.list.d/systancia.list
apt update

We strongly recommend disabling the installation of unnecessary packages when running apt commands. To do so, run the following command:

1
echo -e 'APT::Install-Recommends false;\nAPT::Install-Suggests false;' > /etc/apt/apt.conf.d/99norecommends

Then update the Debian packages already installed on the server:

1
2
apt update
apt dist-upgrade -y

Recommendation

The security hardening guide details the integrity check of the packages and of the APT repositories, and the automation of Debian security updates: see R6 and R7.

Installation of the HTML5 Gateway server

Installation of basic components

Start installing the components using the following command as root:

1
apt install -y ipdiva-base

After downloading all dependencies, a window will open asking you to select the server type. Select gateway:

The values entered are recorded in /etc/ipdiva.conf. Check them:

1
cat /etc/ipdiva.conf
Example for a standalone Mediation Controller
1
2
3
4
5
6
hostType=mediation
loadBalancingMode=standalone
IPdivaHttpsPort=443
IPdivaSslRouterPort=443
HTTPS_ADDRESS="10.0.10.10"
SSL_ADDRESS="10.0.10.11"
What should I do if there is an error?

If there is an error in the information you entered, continue installing the ipdiva-base package and then use the following command to reconfigure the server:

1
dpkg-reconfigure ipdiva-base

Installation of HTML5 Gateway components

Install the HTML5 Gateway components and the configuration tools:

1
apt install -y ipdiva-html5gateway ipdiva-html5-webapp ipdiva-guacamole-server1 ipdiva-gateway-setup

Use the following command lines to enable and configure the file transfer and virtual printer features:

1
2
3
apt install -y ghostscript
echo -e "printer=CyberElements HTML5 Printer\nprinterDriver=MS Publisher Imagesetter" > /etc/guacamole/printer-config
mkdir /home/systanciahtml5share

Then restart the server:

1
reboot

Connecting the HTML5 Gateway

Declaration in the administration console

Declare the HTML5 Gateway in the administration console, without a pairing token, with its access URL (for example HTML5-2) and the WebSocket protocol: Creating an HTML5 Gateway.

Configuration of the HTML5 Gateway

Attention!

If you use certificates issued by a certification authority (CA) other than Systancia's for the SSL Router component, you must add the root CA to the trusted CAs of the server: add the root CA to the trusted CAs of the Edge Gateway or HTML5 Gateway.

Transfer the certificate of the HTML5 Gateway to the /tmp/ directory of the server, then move it into the configuration of the instance, readable by the service only:

1
2
3
mv /tmp/HTML5_CERT_FILE /etc/ipdiva/html5gateway/ssl/
chown root:ipdivasrv /etc/ipdiva/html5gateway/ssl/HTML5_CERT_FILE
chmod 640 /etc/ipdiva/html5gateway/ssl/HTML5_CERT_FILE

Edit the /etc/ipdiva/html5gateway/html5gateway.xml file (several sections have been omitted and are indicated by […]):

Value Variable Definition
MC_SSL_ADDRESS Address of the SSL Router: IP_MC_SSL on a Standalone platform, VIP_MC_SSL on a Cluster.
PORT_MC_SSL Listening port of the SSL Router of the Mediation Controller (usually 443).
HTML5_CERT_PASSWORD Password of the certificate of the HTML5 Gateway.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<gateway>
    <server>MC_SSL_ADDRESS:PORT_MC_SSL:ssl</server>
[…]
    <ssl>
        <cert>/etc/ipdiva/html5gateway/ssl/HTML5_CERT_FILE</cert>
        <password>HTML5_CERT_PASSWORD</password>
[…]
    </ssl>
[…]
</gateway>

Restart the HTML5 Gateway to load the new settings and connect it to the Mediation Controller:

1
systemctl restart ipdiva-html5gateway.service

Configuration of the Mediation Controller

The configuration of the Mediation Controller depends on the placement of the HTML5 Gateway server (see Placements).

The Mediation Controller reaches the HTML5 Gateway server through an Edge Gateway that can connect to it on TCP port 8080.

On the Mediation Controller server (on each server of a cluster), as root, create or edit the /etc/ipdiva/httpd/commonParameters.extra.conf file to add a section equivalent to the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<Location /URL_HTML5/>
        Order allow,deny
        Allow from all
        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-IPdiva-Gateway GW_NAME|
        RequestHeader set X-IPdiva-Orgname ORGANIZATION_NAME
        RequestHeader set X-IPdiva-Service IP_HTML5_GW:8080

        ProxyPass http://127.0.0.1:9016/systanciaHTML5-6.0/ flushpackets=on
</Location>

<Location /URL_HTML5/websocket-tunnel>
        Order allow,deny
        Allow from all
        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-IPdiva-Gateway GW_NAME|
        RequestHeader set X-IPdiva-Orgname ORGANIZATION_NAME
        RequestHeader set X-IPdiva-Service IP_HTML5_GW:8080

        ProxyPass ws://127.0.0.1:9016/systanciaHTML5-6.0/websocket-tunnel
</Location>
HTTP protocol (historical mode)

The configuration above applies to an HTML5 Gateway declared with the WebSocket protocol, recommended because it is the most efficient. For an HTML5 Gateway declared with the HTTP protocol (historical mode, the value proposed by default by the administration console), the section to add is a single block, without a final / after the URL:

1
2
3
4
5
6
7
8
<Location /URL_HTML5>
        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-IPdiva-Gateway GW_NAME|
        RequestHeader set X-IPdiva-Orgname ORGANIZATION_NAME
        RequestHeader set X-IPdiva-Service 127.0.0.1:8080

        ProxyPass http://127.0.0.1:9016/ flushpackets=on
</Location>

URL_HTML5, GW_NAME and ORGANIZATION_NAME are replaced as for the WebSocket protocol, and the X-IPdiva-Service line takes the same value as in that configuration. Each HTML5 Gateway has its own URL: both sections can coexist in the file, for two HTML5 Gateways.

The Mediation Controller connects directly to the HTML5 service of the server, on TCP port 8080, without going through an Edge Gateway.

On the Mediation Controller server (on each server of a cluster), as root, create or edit the /etc/ipdiva/httpd/commonParameters.extra.conf file to add a section equivalent to the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<Location /URL_HTML5/>
        Order allow,deny
        Allow from all
        ProxyPass http://IP_HTML5_GW:8080/systanciaHTML5-6.0/ flushpackets=on
        ProxyPassReverse http://IP_HTML5_GW:8080
</Location>

<Location /URL_HTML5/websocket-tunnel>
        Order allow,deny
        Allow from all
        ProxyPass ws://IP_HTML5_GW:8080/systanciaHTML5-6.0/websocket-tunnel
        ProxyPassReverse ws://IP_HTML5_GW:8080/systanciaHTML5-6.0/websocket-tunnel
</Location>

The HTML5 service receives this connection in clear HTTP: only the Mediation Controller servers must be able to reach TCP port 8080 of the HTML5 Gateway server (see Prerequisites of the HTML5 Gateway). If the local firewall of the Mediation Controller blocks outbound flows (R36, or R39 in a cluster), allow this flow towards IP_HTML5_GW on TCP port 8080.

Check the configuration, then apply it:

1
2
apache2ctl configtest
systemctl reload apache2

Configuring an NTP time server

It is recommended to set up a time server to keep the system clock up to date. The necessary steps are described on the NTP configuration page.