In this article:

Step 1. Check System Requirements

Step 2. Prepare DBMS Back End

Step 3. Install DBMS Front End

Step 4. Install the BI Server

Step 5. Set Up BI Server

Step 6. Create a Metadata Repository

Step 7. Create a Service User of Security Subsystem

Step 8. Install Web Application Back End

Step 9. Set Up Web Application Configuration at Web Server

Step 10. Check BI Server Performance

Step 11. Start the Web Application

Example of Ready PostgreSQL DBMS Script

Foresight Analytics Platform Authentication

Removing BI Server

Removing Web Application Back End

Advanced Installation of Foresight Analytics Platform Web Application on Linux OS (PostgreSQL DBMS)

To work with the web application, the system must be formed using the software of Foresight Analytics Platform, which assumes presence of:

NOTE. BI server, application server, and web application can be located on one physical server. On executing resource-intensive tasks, locate application server and BI server on different physical servers.

The guide describes installation of Foresight Analytics Platform using PostgreSQL DBMS for the following versions of Linux OS:

Installation of BI server (Step 4) and web application back end (Step 8) is executed using the distributions included in the software package of Foresight Analytics Platform:

Linux OS family version Distribution files for BI server installation Distribution files for web server installation
Astra Linux SE 1.7 foresight-fp10.x-biserver_10.4.<build number>~astra~1.7_amd64.deb foresight-fp10.x-webserver_10.4.<build number>~astra~1.7_all.deb
RED OS 7.3 foresight-fp10.x-biserver_10.4.<build number>.redos7.3.x86_64.rpm foresight-fp10.x-webserver_10.4.<build number>.redos7.3.noarch.rpm
Rocky Linux 8 foresight-fp10.x-biserver_10.4.<build number>.rocky8.x86_64.rpm foresight-fp10.x-webserver_10.4.<build number>.rocky8.noarch.rpm
ALT Linux 10 foresight-fp10.x-biserver_10.4.<build number>.alt10.x86_64.rpm foresight-fp10.x-webserver_10.4.<build number>.alt10.noarch.rpm

After the web application is installed, the following directories are created:

Step 1. Check System Requirements

Make sure that the system meets requirements for:

See also requirements for operating system settings and supported PostgreSQL DBMS versions.

Step 2. Prepare DBMS Back End

The preparation consists of creating a database and a user that will be administrator of this database.

After executing all DBMS preparation operations, it is recommended to check user connection to the created database using DBMS means. If there will be any repository connection problems, it may also be necessary to check user access permissions and additional setup on DBMS level.

PostgreSQL server is prepared by the DBMS administrator.

IMPORTANT. To ensure system security before preparing the PostgreSQL server, check settings of the lc_messages parameter in the postgresql.conf configuration file. The PostgreSQL message language should match with operating system language settings.

To prepare the PostgreSQL server, execute scripts using any of the available methods, for example, via the pgAdmin application. Take into account the following features on executing the scripts:

TIP. To prepare a PostgreSQL server in Linux OS, use ready script. After executing the script the following is created: the NEW_USER database user with the NEW_USER password, the NEW_DATABASE database, the repository with the NEW_DATABASE identifier, and the SERVICE_USER service user with the SERVICE_USER password.

Creating a Database User

To create a database user, execute the script:

CREATE ROLE "USER_NAME" LOGIN ENCRYPTED PASSWORD 'USER_PASSWORD' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;

Where:

IMPORTANT. The ADMIN user name must not be used.

Creating a Database

To create a database, execute the script:

CREATE DATABASE "DATABASE_NAME" WITH OWNER = "USER_NAME" ENCODING = 'UTF8' TABLESPACE = pg_default  LC_COLLATE = default LC_CTYPE = default CONNECTION LIMIT = -1;

ALTER DATABASE "DATABASE_NAME" SET lo_compat_privileges = 'on';

GRANT ALL ON DATABASE "DATABASE_NAME" TO "USER_NAME";

Where:

IMPORTANT. A database is created via the postgres service database by default. To proceed with DBMS server preparation, connect to the created database.

Creating a Custom Schema in the Current Database

The public schema is used by default. When working with the public schema take into account the features given in the Features of Working with PostgreSQL DBMS section.

To create a custom schema in the current database, execute the script:

CREATE SCHEMA "SCHEMA_NAME" AUTHORIZATION "USER_NAME";

Where:

After executing the operations a custom schema will be created. The user created at Step 1 will be a schema owner.

To use the custom schema as a default schema, execute the script:

SET search_path TO "SCHEMA_NAME";

After executing the operations, the custom schema will be used instead of the public default schema.

NOTE. For details about working with custom schemas, see PostgreSQL documentation.

Support of the Lo Data Type

The Lo data type is used to save multibyte information in PostgreSQL. By default, after a database is created, support of working with this data type is disabled. To enable the support of the Lo data type, execute the script:

SET search_path TO "SCHEMA_NAME";

CREATE FUNCTION loin (cstring) RETURNS lo AS 'oidin' LANGUAGE internal IMMUTABLE STRICT;

CREATE FUNCTION loout (lo) RETURNS cstring AS 'oidout' LANGUAGE internal IMMUTABLE STRICT;

CREATE FUNCTION lorecv (internal) RETURNS lo AS 'oidrecv' LANGUAGE internal IMMUTABLE STRICT;

CREATE FUNCTION losend (lo) RETURNS bytea AS 'oidsend' LANGUAGE internal IMMUTABLE STRICT;

CREATE TYPE lo (INPUT = loin, OUTPUT = loout, RECEIVE = lorecv, SEND = losend, INTERNALLENGTH = 4, PASSEDBYVALUE);

CREATE CAST (lo AS oid) WITHOUT FUNCTION AS IMPLICIT;

CREATE CAST (oid AS lo) WITHOUT FUNCTION AS IMPLICIT;

CREATE OR REPLACE FUNCTION lo_manage() RETURNS pg_catalog.trigger AS '$libdir/lo' LANGUAGE C;

Where:

NOTE. If one or several custom schemas are used, execute the script for each schema. If a custom schema is not created, execute the script without specifying the SCHEMA_NAME parameter. The public schema is used by default.

Features of Working with PostgreSQL DBMS

If the default public schema is used for work, all repository users will be able to create tables. It may cause issues with user updates and separation of access permissions of the users who are repository administrators. To avoid possible errors it is recommended to create all objects only under the user created at Step 1 and who is owner and administrator of the ADMIN schema.

Default configuration for PostgreSQL servers includes autovacuum - clearing of space occupied by data deleted from tables using the VACUUM SQL command. Statistic that is used by scheduler to select query execution method is also updated. If it is supposed that intensive work consisting in changing data in tables, it is recommended to set up configuration in such a way that autovacuum is executed in server low-load time (night, weekend). The setup can be executed using the documentation at the developer website.

Step 3. Install DBMS Front End

To install PostgreSQL DBMS front end, execute the command:

sudo apt-get install postgresql-client

sudo yum install postgresql postgresql-libs

sudo dnf install postgresql postgresql-libs

sudo apt-get install postgresql14

After executing the operation, the PostgreSQL driver is installed that is used by Foresight Analytics Platform to interact with database server.

Alternatively, Postgres Pro client can be installed. The installation guide is available at the manufacturer's website.

If BI server is installed manually from archive or DBMS front end is installed after BI server installation, create a symbolic link using the command:

sudo ln -s /usr/lib/x86_64-linux-gnu/libpq.so.5 /usr/lib/x86_64-linux-gnu/libpq.so

sudo ln -s /usr/lib64/libpq.so.5 /usr/lib64/libpq.so

Step 4. Install the BI Server

To install BI server:

  1. Make sure that you are connected to the Internet.

  2. Update information about packages:

sudo apt-get update

sudo yum update

  1. Copy the foresight-fp10.x-biserver*.deb/rpm distribution file from the software package to the /home/<user name> home directory. Name of the distribution file depends on Linux OS version.

If required, determine a user name, under whom the BI server is to be installed:

whoami

  1. Install the copied BI server distribution file:

sudo dpkg -i foresight-fp10.x-biserver*.deb

sudo yum localinstall foresight-fp10.x-biserver*.rpm

sudo dnf install foresight-fp10.x-biserver*.rpm

sudo apt-get install -y foresight-fp10.x-biserver*.rpm

  1. Set missing dependencies for Astra Linux:

sudo apt-get -f install

If required, update again information about packages.

For correct work use actual versions of libraries from system repositories.

NOTE. The required libraries are contained in BI server distribution file and do not require additional installation. The appropriate message is displayed on installing missing libraries.

List of libraries for the fp10.x-biserver package

The installation procedure includes the following:

NOTE. To change BI server version, install another package version over the previous one. Configuration files are saved if their version is not updated in the package.

Steps 9 and 10 use substitutions:

To view the required ports, use:

To determine server IP address, execute the command:

ip address

To determine DNS server name, execute the command:

hostname

Setting Up Logging

To track BI server performance and register various errors, enable system message logging if required. To do this, add the following strings in the file /opt/foresight/fp10.x-biserver/etc/envvars:

PP_LOG=1

PP_LOGTIME=1

By default, system messages are written:

Step 5. Set Up BI Server

To set up BI server:

  1. Disable the AstraMode mode for the apache2-fp10.x instance in Astra Linux. To do this, replace the #AstraMode on string in the /etc/apache2-fp10.x/apache2.conf file with the following one:

AstraMode off

  1. Start the Apache2 web server:

sudo systemctl start apache2-fp10.x

sudo systemctl start httpd-fp10.x

sudo systemctl start httpd2-fp10.x

  1. Create the Metabases.xml file to set up repository connection:

sudo nano /opt/foresight/fp10.x-biserver/etc/Metabases.xml

  1. Fill in the Metabases.xml file:

<PP>
  <Metabases>
    <REPOSITORY_ID Name="REPOSITORY_ID" Authentication="1" Driver="DRIVER_ID" Package="STANDARDSECURITYPACKAGE" DebugMode="1">
      <LogonData DATABASE="DATABASE_NAME" SERVER="SERVER_DATABASE" CASESENSITIVE="true"/>
      <Credentials Authentication="1"/>
    </REPOSITORY_ID>
  </Metabases>
</PP>

Where:

Depending on repository connection settings, a list of repositories is created in the login dialog box to log in to the system.

If required, download and unpack the Metabases.zip archive with the example of filling in the Metabases.xml file.

  1. Activate license. To do this, add the LSFORCEHOST variable in the end of the file /opt/foresight/fp10.x-biserver/etc/envvars in the /etc/environment global variables file:

LSFORCEHOST=<server name>

LSFORCEHOST=NO-NET

To apply settings in the /etc/environment file, restart the operating system.

  1. Grant access permissions for the Apache2 user for the folder with installed BI server:

sudo chown -R www-data:www-data /opt/foresight/fp10.x-biserver

sudo chown -R apache:apache /opt/foresight/fp10.x-biserver

sudo chown -R apache2:apache2 /opt/foresight/fp10.x-biserver

  1. Restart the BI server:

sudo systemctl restart apache2-fp10.x

sudo systemctl restart httpd-fp10.x

sudo systemctl restart httpd2-fp10.x

The installed BI server will work in background mode as a separate Linux service. The Apache2 instance with BI server will be started by default at the 8810 port. To view the required ports, use:

Step 6. Create a Metadata Repository

To create a metadata repository on PostgreSQL server:

  1. Change the current directory with the BI server installation folder:

cd /opt/foresight/fp10.x-biserver/bin

  1. Install the additional package xvfb-run in ALT Linux:

sudo apt-get install xvfb-run

  1. Start the RepoManager console application using the RepoManager_start.sh script with the specified parameters:

./RepoManager_start.sh -ocreate-repo -tpostgres -sSERVER_DATABASE -pPORT -uUSER_NAME -wUSER_PASSWORD -dDATABASE_NAME -fRM_FILE -i

./RepoManager_start.sh -ocreate-repo -tpostgres -sSERVER_DATABASE -pPORT -uUSER_NAME -wUSER_PASSWORD -dDATABASE_NAME –mSCHEMA_NAME -fRM_FILE -i

Where:

After executing the operation a metadata repository will be created in the specified DBMS in the default public schema or custom schema with taking case into account. When preparing the DBMS back end at Step 2, parameters should be set in upper case, that is why enabling case sensitivity is mandatory.

Step 7. Create a Service User of Security Subsystem

A service user of security subsystem ensures:

To create a service user of security subsystem:

  1. Create service user credentials on the database server.

IMPORTANT. A service user of security subsystem can be created only once. If a database server already contains service user credentials, skip this step.

  1. Save the created service user credentials on the computer with installed BI server.

After executing the operations, a service user of security subsystem will be created on the database server and saved according to the selected method on the computer with installed BI server.

TIP. It is recommended to disable the mandatory periodic password change policy for an account of service user of security subsystem in DBMS.

Creating Service User Credentials

To create service user credentials, start the PP.Util utility located in the folder with installed BI server: /opt/foresight/fp10.x-biserver/bin with the following parameters:

sudo -E /opt/foresight/fp10.x-biserver/bin/PP.Util_start.sh /create_audit_user metabase_id login password audit_login audit_password db_login db_password

Where:

NOTE. The P4AUDIT server user name is reserved by the system and cannot be used.

Saving Created Service User Credentials

To save the created service user credentials on the computer with installed BI server:

  1. Start the PP.Util utility located in the folder with installed BI server: /opt/foresight/fp10.x-biserver/bin with the following parameters:

sudo /opt/foresight/fp10.x-biserver/bin/PP.Util_start.sh /save_audit_creds /ALG enc_alg realm|/DC login password

Where:

IMPORTANT. To ensure security during production operation of Foresight Analytics Platform, use the gos value.

Optional parameter. If the parameter is not set, the default value is used.

For example: "127.0.0.1|POSTGRES".

NOTE. To avoid syntax errors, enclose the value in quotation marks.

Mandatory parameter.

After executing the operations service user credentials are saved on the computer with BI server in the settings.xml file at: /opt/foresight/fp10.x-biserver/etc.

Examples of command use:

sudo /opt/foresight/fp10.x-biserver/bin/PP.Util_start.sh /save_audit_creds "10.30.210.10|POSTGRES" SERVICE_USER_NAME SERVICE_USER_PASSWORD

sudo /opt/foresight/fp10.x-biserver/bin/PP.Util_start.sh /save_audit_creds /DC SERVICE_USER_NAME SERVICE_USER_PASSWORD

Step 8. Install Web Application Back End

To install web application back end:

  1. Make sure that you are connected to the Internet.

  2. Copy the foresight-fp10.x-webserver*.deb/rpm distribution file from the software package to the home directory /home/<user name>. Name of the distribution file depends on Linux OS version.

  3. Install the copied web server distribution file:

sudo dpkg -i foresight-fp10.x-webserver*.deb

sudo yum localinstall foresight-fp10.x-webserver*.rpm

sudo dnf install foresight-fp10.x-webserver*.rpm

sudo apt-get install -y foresight-fp10.x-webserver*.rpm

  1. Disable the AstraMode mode for the apache2-fp10.x-web instance in Astra Linux. To do this, replace the #AstraMode on string in the /etc/apache2-fp10.x-web/apache2.conf file with the following one:

AstraMode off

List of dependencies for the fp10.x-webserver package

The web application back end will be installed to the folder /opt/foresight/fp10.x-webserver. During the installation, a new instance of apache2-fp10.x-web will be created and set up for Astra Linux, httpd-fp10.x-web - for RED OS and Rocky Linux, httpd2-fp10.x-web - for ALT Linux. The web application will be set up to work with a local BI server via the 8810 port. The BI server URL can be changed in the file /opt/foresight/fp10.x-webserver/config/PP.xml. The web application itself is available via the 8110 port.

Steps 9 and 10 use substitution:

To determine server IP address, execute the command:

ip address

To determine DNS server name, execute the command:

hostname

Step 9. Set Up Web Application Configuration at Web Server

To set up web application configuration, use the files:

Setting Up Configuration Parameters in the PP.xml File

It is used to set up BI server connection and to specify web application parameters:

  1. Open the PP.xml file. The file contains the following structure by default:

<?xml version="1.0" encoding="utf-8"?>
<pp>
    <proxy url="http://<current IP address>:8810/fpBI_App_v10.x/axis2/services/PP.SOM.Som"/>
    <metabase id="" />
    <serviceCM ParamsUrl="http://<current IP address>:8110/fp10.x/r/#/settings"/>
    <modules commonModulesUrl="http://<current IP address>:8110/fp10.x/r/#">
    </modules>
</pp>

  1. Set BI server connection parameters:

http://<BI server>:<port number>/fpBI_App_v10.x/axis2/services/PP.SOM.Som

NOTE. If the <proxy> section is used, requests are executed via the web application back end that is PPService.axd. If the <service> section is used, requests are executed directly in the browser avoiding the web application back end.

If the <proxy> section is used, value of the url attribute is not taken into account. BI server connection parameters are contained in the following files:

PP_SOM=http://localhost:8810/fpBI_App_v10.x/axis2/services/PP.SOM.Som

ProxyPass /fp10.x/app/PPService.axd ${PP_SOM} retry=1 acquire=3000 timeout=6000 Keepalive=On

http://<web server>:8110/fp10.x/r/#/settings

http://<web server>:8110/fp10.x/r/#

  1. Restart the web server:

sudo systemctl restart apache2-fp10.x
sudo systemctl restart apache2-fp10.x-web

sudo systemctl restart httpd-fp10.x
sudo systemctl restart httpd-fp10.x-web

sudo systemctl restart httpd2-fp10.x
sudo systemctl restart httpd2-fp10.x-web

The example of the PP.xml file:

<?xml version="1.0" encoding="utf-8" ?>
<pp>
  <service url="http://10.7.0.100:8810/fpBI_App_v10.x/axis2/services/PP.SOM.Som"/>
  <metabase id="WAREHOUSE" />

  <serviceCM ParamsUrl="http://10.7.0.100:8110/fp10.x/r/#/settings"/>

  <modules commonModulesUrl="http://10.7.0.100:8110/fp10.x/r/#">

  </modules>
</pp>

Setting Up Configuration Parameters in the config.json File

To open tools and repository objects in the web application:

  1. Open the config.json file. The file contains the following structure by default:

{
  "targetRepo": "",
  "serviceUrl": "http://<current IP address>:8110/fp10.x/app/PPService.axd",
  "locale": "ru",
  "locales": ["ru"],
  "title": "FAP10",
  "baseUrl": "http://<current IP address>:8110/fp10.x/"
}

  1. Set fields in JSON:

NOTE. Identifier of the repository specified as the id attribute in the <metabase> section of the PP.xml file should match with the repository identifier specified in the targetRepo field.

http://<web server>:8110/fp10.x/app/PPService.axd

By default, only one element corresponding to Russian is included into array. If English is added to the array, the start page used for logging in to repository will contain hyperlinks to switch the interface language.

http://<current IP address>:8110/fp10.x/

  1. Restart the web server:

sudo systemctl restart apache2-fp10.x
sudo systemctl restart apache2-fp10.x-web

sudo systemctl restart httpd-fp10.x
sudo systemctl restart httpd-fp10.x-web

sudo systemctl restart httpd2-fp10.x
sudo systemctl restart httpd2-fp10.x-web

The example of the config.json file:

{

  "targetRepo": "WAREHOUSE",

  "serviceUrl": "http://10.7.0.100:8110/fp10.x/app/PPService.axd",

  "locale": "ru",

  "locales": ["ru"],

  "title": "Foresight",
  "baseUrl": "http://10.7.0.100:8110/fp10.x/"  

}

Step 10. Check BI Server Performance

To check BI server performance:

  1. Copy BI server URL:

http://<BI server>:<port number>/fpBI_App_v10.x/axis2/services/PP.SOM.Som

Where:

  1. Create two URLs and open them in the browser:

http://localhost:8810/fpBI_App_v10.x/axis2/services/PP.SOM.Som?wsdl

http://localhost:8810/fpBI_App_v10.x/axis2/services

If browser displays an error, check BI server settings and restart it.

If BI server works correctly, the set of available operations to work with web service opens as an XML file on clicking the first link, and as a list on clicking the second link.

Step 11. Start the Web Application

To start the web application, open the web browser and enter web application URL in the address field:

http://<web server>:8110/fp10.x/r/#

After executing the operation the login box opens. By default, the connection is established to the repository specified in the PP.xml file at Step 9. To connect to a different repository, specify its identifier in the address field:

http://<web server>:8110/fp10.x/r/#/login?repo=<repository identifier>

The list of available repositories is created in the Metabase.xml file created at Step 5.

NOTE. Authorization in the web application may be accompanied by the errors caused by CORS policy restrictions.

To solve the problem and increase system security when exchanging data between different domains, set up the CORS mechanism:

  1. Open the file:

  1. Set the headers Origin, Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers:

<IfModule mod_headers.c>

    SetEnvIf Origin ^(<allowed domain>)$ CORS_ALLOW_ORIGIN=$1

    Header always set Access-Control-Allow-Origin %{CORS_ALLOW_ORIGIN}e env=CORS_ALLOW_ORIGIN

    Header merge Vary "Origin"

    Header always set Access-Control-Allow-Methods "POST, OPTIONS, <HTTP request methods>"

    Header always set Access-Control-Allow-Headers "get-ppbi-time, content-type, soapaction, accept-language, cache-control, Authorization, <HTTP request headers>"

</IfModule>

RewriteEngine On

    RewriteCond %{REQUEST_METHOD} OPTIONS

    RewriteRule ^(.*)$ $1 [R=200,L]

In the substitutions:

https?://(?:.+\.)?example\.com(?::\d{1,5})?

This setting enables the use of the CORS mechanism on the parent and the child domains, and it is also dynamically installed to the current protocol, domain, port without the use of overriding rules.

NOTE. Make sure that the specified parameters of the CORS mechanism meet the requirements of the resource in use.

  1. Connect the headers, rewrite modules in Astra Linux:

sudo a2enmod-fp10.x headers rewrite

  1. Restart the BI server:

sudo systemctl restart apache2-fp10.x

sudo systemctl restart httpd-fp10.x

sudo systemctl restart httpd2-fp10.x

Example of Ready PostgreSQL DBMS Script

The example contains all parts of selected scripts for the PostgreSQL DBMS given at Steps 2, 6, 7:

Foresight Analytics Platform Authentication

Foresight Analytics Platform provides several authentication methods. Authentication method is selected depending on the required security measures during repository access setup.

User credentials can be checked on DBMS server and/or in Foresight Analytics Platform.

The following basic authentication types are available:

For details see the Foresight Analytics Platform Authentication section.

To use integrated domain or domain authentication, enable domain group support on PostgreSQL server and execute setup according to the Setting Up Domain/Integrated Domain Authentication on Apache2 Web Server section.

Removing BI Server

To remove BI server files without removing configuration files, execute the command:

sudo apt-get remove fp10.x-biserver

sudo yum remove fp10.x-biserver

After executing the operation the BI server files are removed. Configuration files in the folders /etc/apache2-fp10.x and /etc/opt/foresight/fp10.x-biserver, as well as new files not included in the setup package in these folders and in /opt/foresight/fp10.x-biserver will be saved and can be used on the next distribution file installation.

To delete BI server with configuration files, execute the command:

sudo apt-get purge fp10.x-biserver

sudo yum purge fp10.x-biserver

sudo apt-get remove --purge fp10.x-biserver

After executing the operation, the BI server will be deleted with configuration files. In this case, new files that are not included into the setup package are saved.

Removing Web Application Back End

To remove web server files without removing configuration files, execute the command:

sudo apt-get remove fp10.x-webserver

sudo yum remove fp10.x-webserver

After executing the operation, web server files will be removed. Configuration files in the folders /etc/apache2-fp10.x-web and /etc/opt/foresight/fp10.x-webserver, as well as new files not included in the setup package in these folders and in /opt/foresight/fp10.x-webserver will be saved and can be used on the next distribution file installation.

To delete web server with configuration files, execute the command:

sudo apt-get purge fp10.x-webserver

sudo yum purge fp10.x-webserver

sudo apt-get remove --purge fp10.x-webserver

After executing the operation, the web server will be deleted with configuration files. In this case, new files that are not included into the setup package are saved.

See also:

Installing and Setting Up Foresight Analytics Platform