Installing and configuring PostgreSQL (Linux)
5 March 2024
ID 192975
Kaspersky Scan Engine GUI requires PostgreSQL 10.7 or later. The following procedure covers installation and configuration of PostgreSQL 10.7. The procedure for a later version may vary.
To install and configure PostgreSQL:
- Download and install PostgreSQL.
You can install PostgreSQL in one of the following ways:
- Install the package downloaded from the PostgreSQL website.
Visit https://www.postgresql.org/download/ to see a list of supported operating systems and installation instructions for each of them.
- Install PostgreSQL from source code.
Visit https://www.postgresql.org/docs/10/installation.html for installation instructions.
- Install the package downloaded from the PostgreSQL website.
- Open the
postgresql.conf
configuration file. The location of this file varies depending on your operating system:- In Debian-based Linux distributions
postgresql.conf
is located at/etc/postgresql/10/main/
. - In RedHat-based Linux distributions
postgresql.conf
is located at/var/lib/pgsql/data/
.
If you use another operating system, the location of
postgresql.conf
may be different. - In Debian-based Linux distributions
- Specify the IP address that Kaspersky Scan Engine must use to connect to PostgreSQL in the
listen_addresses
setting ofpostgresql.conf
. - Specify the port on which the PostgreSQL is to listen for connections from Kaspersky Scan Engine in the
port
setting ofpostgresql.conf
. - Save and close
postgresql.conf
. - Open the
pg_hba.conf
configuration file. This file is located in the same directory aspostgresql.conf
. - Specify that PostgreSQL must require an MD5-encrypted password for authentication from all of its clients:
- Find the following line in
pg_hba.conf
:host all all 127.0.0.1/32 peer
- Change this line to:
host all all 127.0.0.1/32 md5
If the
pg_hba.conf
configuration file does not contain thehost all all 127.0.0.1/32 peer
line, you have to change thehost all all 127.0.0.1/32 ident
line. - Find the following line in
- If PostgreSQL and Kaspersky Scan Engine are installed on different computers, add the following line to
pg_hba.conf
:host all all %IP%/32 md5
Here
%IP%
is the IP address of the computer on which Kaspersky Scan Engine is installed. - Save and close
pg_hba.conf
. - Restart PostgreSQL by running the following command from the command line:
service postgresql restart
- Set the password for the default PostgreSQL user.
During installation PostgreSQL creates a superuser called
postgres
. By default, this user does not a have a password.To set the password for the
postgres
user:- From the command line, change the correct user to the
postgres
user:su postgres
- Under the
postgres
user account, start the psql utility by running the following command in the command line:psql
- In psql, change the password of the
postgres
user by running the following command:alter user postgres with password '%PASSWORD%';
Here
%PASSWORD%
is the new password for thepostgres
user. - Quit the psql utility by running the following command in psql:
\q
- From the command line, change the correct user to the
You can now install Kaspersky Scan Engine GUI.
To install Kaspersky Scan Engine GUI, you need a PostgreSQL user that has permissions for creating new databases and users. You can use the postgres user for that, or create a new user.
After installing PostgreSQL and setting the password for the postgres
user, you can proceed to section "Automatic installation (Linux)" or "Manual installation (Linux)".
All data is stored in a single database called kavebase. Kaspersky Scan Engine does not use any other databases.