You can store Certificate Enrollment Gateway data in an external PostgreSQL database. This topic describes how to deploy a PostgreSQL database for Certificate Enrollment Gateway.
To deploy a PostgreSQL database for Certificate Enrollment Gateway
- Download the PostgreSQL database from https://www.postgresql.org.
- Install PostgreSQL according to the instructions in the PostgreSQL documentation. As you install PostgreSQL:
- Enter and record the password for the database superuser. You need this password later. By default, the database superuser is named postgres.
- Enter and record the port used to connect to the database. You need this port later. By default, the port is 5432.
- Create a database user for Certificate Enrollment Gateway:
- On the PostgreSQL server, navigate to the directory containing the PostgreSQL
createuser
command. - Enter the following command to create a new database user for Certificate Enrollment Gateway: Where:
createuser -U <superuser> -P <user>
<superuser>
is the name of the database superuser.<user>
is the name of the new database user.
- For example:
createuser -U postgres -P ceguser
- When prompted, enter a password for the new database user.
- When prompted, confirm the password by entering it again.
- When prompted, enter the password of the database superuser.
- On the PostgreSQL server, navigate to the directory containing the PostgreSQL
- Create a new database instance for Certificate Enrollment Gateway:
- On the PostgreSQL server, navigate to the directory containing the PostgreSQL
createdb
command. - Enter the following command to create a new database instance for Certificate Enrollment Gateway: Where:
createdb -U <superuser> -O <user> <database>
<superuser>
is the name of the database superuser.<user>
is the name of the database user you created in the previous step. This database user will own the new database instance.<database>
is the name of the new database instance.
- For example:
createdb -U postgres -O ceguser ceg
- When prompted, enter the password of the database user.
- On the PostgreSQL server, navigate to the directory containing the PostgreSQL
- Configure PostgreSQL to allow connections from Certificate Enrollment Gateway:
- In the
postgresql.conf
file, modify thelisten_addresses
setting to include the address of the appliance hosting Certificate Enrollment Gateway. - In the
pg_hba.conf
file, enable host-based authentication for the appliance hosting Certificate Enrollment Gateway. For example:For details about this file, see the PostgreSQL documentation.host ceg ceguser server.example.com scram-sha-
256
- Restart PostgreSQL for the changes to take effect.
- In the