Difference between revisions of "PKI ACME Responder with PostgreSQL Database"

From Dogtag
Jump to: navigation, search
m (Removing Database)
m (Initializing Database)
Line 16: Line 16:
 
psql> create database acme owner acme;
 
psql> create database acme owner acme;
 
</pre>
 
</pre>
 
Use the provided [https://github.com/dogtagpki/pki/blob/master/base/acme/conf/database/postgresql/create.sql create.sql] to initialize the ACME database.
 
  
 
To initialize a local database:
 
To initialize a local database:
Line 24: Line 22:
 
$ sudo -u postgres psql \
 
$ sudo -u postgres psql \
 
     -d acme \
 
     -d acme \
     -f /usr/share/pki/acme/conf/database/postgresql/create.sql
+
     -f /usr/share/pki/acme/database/postgresql/create.sql
 
</pre>
 
</pre>
  
Line 30: Line 28:
  
 
<pre>
 
<pre>
$ psql <url> -f /usr/share/pki/acme/conf/database/postgresql/create.sql
+
$ psql <url> -f /usr/share/pki/acme/database/postgresql/create.sql
 
</pre>
 
</pre>
  

Revision as of 03:31, 29 July 2020

Installing JDBC Driver

$ dnf install postgresql-jdbc
$ cd /usr/share/pki/server/common/lib
$ ln -s /usr/share/java/postgresql-jdbc/postgresql.jar

Initializing Database

To create a database:

$ sudo -u postgres psql
psql> create user acme with password 'Secret.123';
psql> create database acme owner acme;

To initialize a local database:

$ sudo -u postgres psql \
    -d acme \
    -f /usr/share/pki/acme/database/postgresql/create.sql

To initialize a remote database:

$ psql <url> -f /usr/share/pki/acme/database/postgresql/create.sql

Configuring ACME Responder

To configure PKI ACME responder with a PostgreSQL database:

$ cp /usr/share/pki/acme/database/postgresql/database.conf /etc/pki/pki-tomcat/acme/database.conf

The configuration will be stored in /etc/pki/pki-tomcat/acme/database.conf, for example:

class=org.dogtagpki.acme.database.PostgreSQLDatabase
url=jdbc:postgresql://localhost.localdomain:5432/acme
user=acme
password=Secret.123

Removing Database

To remove a local database:

$ sudo -u postgres psql \
    -d acme \
    -f /usr/share/pki/acme/database/postgresql/drop.sql

To remove a remote database:

$ psql <url> -f /usr/share/pki/acme/database/postgresql/drop.sql

See Also