Configuring the PostgreSQL Database


Step 1. Log in to pgAdmin as "postgres".

Step 2. Create a new user:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on postgres, and select Query Tool.

    

3. In the Query Editor window, enter the following statement to create a user:

CREATE ROLE username WITH
	LOGIN
	NOSUPERUSER
	NOCREATEDB
	NOCREATEROLE
	INHERIT
	NOREPLICATION
	CONNECTION LIMIT -1
	PASSWORD 'password';

4. To execute the statement, click the Execute icon or press F5.

Step 3. Create an activity database and bind it to the created user:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on postgres, and select Query Tool.

    

3. In the Query Editor window, enter the following statement to create an activity database and bind it to the user created:

CREATE DATABASE ekranactivitydb
    WITH 
    OWNER = username
    ENCODING = 'UTF8'
    CONNECTION LIMIT = -1;

4. To execute the statement, click the Execute icon or press F5.

Step 4. Configure the activity database:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on ekranactivitydb, and select Query Tool.

3. In the Query Editor window, enter the following statement to grant permissions to the user, create the main schema used in Ekran System, set up the dbo as a default schema, and create the pgcrypto extension:

GRANT ALL ON DATABASE ekranactivitydb TO username;

CREATE SCHEMA dbo
    AUTHORIZATION username;

GRANT ALL ON SCHEMA dbo TO username;

ALTER DATABASE ekranactivitydb
    SET search_path TO dbo;

CREATE EXTENSION pgcrypto SCHEMA dbo;

 4. To execute the statement, click the Execute icon or press F5.

Step 5. Create a UBA database and bind it to the user created:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on postgres, and select Query Tool.

    

3. In the Query Editor window, enter the following statement to create a UBA database and bind it to the user created:

CREATE DATABASE ekranubadatabase
    WITH 
    OWNER = username
    ENCODING = 'UTF8'
    CONNECTION LIMIT = -1;

4. To execute the statement, click the Execute icon or press F5.

Step 6. Grant permissions to the user created for the UBA database:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on ekranubadatabase, and select Query Tool.

3. In the Query Editor window, enter the following statement to grant permissions to the user:

GRANT ALL ON DATABASE ekranubadatabase TO username;

4. To execute the statement, click the Execute icon or press F5.

Step 7. Create a management database and bind it to the user created:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on postgres, and select Query Tool.

    

3. In the Query Editor window, enter the following statement to create a management database and bind it to the user created: 

CREATE DATABASE ekranmanagementdatabase
    WITH 
    OWNER = username
    ENCODING = 'UTF8'
    CONNECTION LIMIT = -1;

4. To execute the statement, click the Execute icon or press F5.

Step 8. Grant permissions for the management database to the user created:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on ekranmanagementdatabase, and select Query Tool.

3. In the Query Editor window, enter the following statement to grant permissions to the user:

GRANT ALL ON DATABASE ekranmanagementdatabase TO username;

 4. To execute the statement, click the Execute icon or press F5.

Step 9. Create an archive database and bind it to the user created:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on postgres, and select Query Tool.

    

3. In the Query Editor window, enter the following statement to create an archive database and bind it to the created user: 

CREATE DATABASE archivedb
    WITH 
    OWNER = username
    ENCODING = 'UTF8'
    CONNECTION LIMIT = -1;

4. To execute the statement, click the Execute icon or press F5.

Step 10. Configure the archive database:

1. In the Browser pane, expand the Databases sub-node.

2. In the Databases sub-node, right-click on archivedb, and select Query Tool.

3. In the Query Editor window, enter the following statement to grant permissions to the user, create the main schema used in Ekran System, set up the dbo as a default schema, and create the pgcrypto extension:

GRANT ALL ON DATABASE archivedb TO username;

CREATE SCHEMA dbo
    AUTHORIZATION username;

GRANT ALL ON SCHEMA dbo TO username;

ALTER DATABASE archivedb
    SET search_path TO dbo;

CREATE EXTENSION pgcrypto SCHEMA dbo;

 4. To execute the statement, click the Execute icon or press F5.

Step 11. Install the Ekran System Application Server using the database created.

To install the Application Server, do the following:

1. Run the installation file (EkranSystem_Server.exe) to open the Ekran System Setup wizard.

2. On the Welcome to the Ekran System Setup page, click the Next button.

3. On the License Agreement page, carefully read the End User License Agreement, and then click the I agree button.

4. On the Choose the Installation Mode page, make sure the New Ekran System Application Server option in the drop-down list is selected, and then click Next.

    

5. On the Choose Install Location page, enter the installation path or click Browse to navigate to the Application Server installation folder, and then click Next.

    

6. On the Database Type page, select the PostgreSQL option, and click Next.

    

7. On the PostgreSQL Server Database Configuration page, define the connection parameters for the database created, and then click Next.

• Enter the name of the PostgreSQL Server instance. Optionally, you can define a custom PostgreSQL database port by entering its name after the Server instance name, separating them by a colon (e.g. <server_instance_name>:<port>).

• Enter the Database name of the database created.

• Enter the User name and password of the user created in Step 2 (Create a new user).

    

8. In the window that opens, click Yes to use the database created.

    

9. On the Administrator password page, enter a password for the administrator (the default user of Ekran System with login "admin" and full permissions)., and click Next.

    

10. On the Ekran System Client Uninstallation Key page, enter a key that will be used for uninstalling Clients locally, and click Next (by default, the Uninstallation key is "allowed", and it can be changed in the Management Tool at any time later).

    

11. Click Install.

12. The installation process starts, and its progress is displayed on the Installing page.

13. When installation is complete, click Finish to exit the Setup wizard.

14. If you are installing the Ekran System Application Server for the first time, back up EkranMasterCertificate. The backup copy of the certificate may be needed later for Application Server recovery or during updates.

15. If you already have a backup copy of the Master Certificate and are reusing the database, delete the Master Certificate, and import the backup copy to use instead.

16. In Windows Firewall, you must allow the Application Server executable to accept TCP connections via ports 9447 (for the connection between the Application Server and the Clients), 22712, 22713, and 22714 (for the connection between the Application Server and the Management Tool). These rules will be added to Windows Firewall automatically if Windows Firewall is enabled during installation of the Application Server.