Install Developer Portal with custom PG database name

This article covers the approach to install developer portal using custom Postgres DB name, DB user either on standalone PG node or on Edge Postgres node

For those who are looking for using custom DB name for on-premise developer portal PG database, noticed that ‘-pdb’ option doesn’t create PG database with custom name during Developer portal install. This article covers the approach followed to install developer portal using custom Postgres DB name, DB user

Configuration File

DP Config file

This Developer portal installation would be referring to below configuration file

Silent Config file ## DPConfigfile.txt

# Portal IP or DNS name.

IP1=IPorDNSnameOfNode


# PG Database for portal IP or DNS name.

IP2=IPorDNSnameOfNode


# Must resolve to IP address or DNS name of host - not to 127.0.0.1 or localhost.

HOSTIP=$(hostname -i)


# Specify the name of the portal database in Postgres.

PG_NAME=CustPortal


# Specify the Postgres admin credentials.

# The portal connects to Postgres by using the 'apigee' user.

# If you changed the Postgres password from the default of 'postgres'

# then set PG_PWD accordingly.

# If connecting to a Postgres node installed with Edge,

# contact the Edge sys admin to get these credentials.

PG_USER=CustUser

PG_PWD=Custpwd123!


# The IP address of the Postgres server.

# If it is installed on the same node as the portal, specify that IP.

# If connecting to a remote Postgres server,specify its IP address.

PG_HOST=$IP2


# The Postgres user credentials used by the portal

# to access the Postgres database,

# This account is created if it does not already exist.

DRUPAL_PG_USER=drupaladmin

DRUPAL_PG_PASS=portalSecret


# Specify 'postgres' as the database.

DEFAULT_DB=postgres


# Specify the Drupal admin account details.

# DO NOT set DEVPORTAL_ADMIN_USERNAME=admin.

# The installer creates this user on the portal.

DEVPORTAL_ADMIN_FIRSTNAME=firstName

DEVPORTAL_ADMIN_LASTNAME=lastName

DEVPORTAL_ADMIN_USERNAME=userName

DEVPORTAL_ADMIN_PWD=PORTAL_ADMIN_PASSWORD

DEVPORTAL_ADMIN_EMAIL=foo@bar.com


# Edge connection details.

# If omitted, you can set them in the portal UI.

# Specify the Edge organization associated with the portal.

EDGE_ORG=edgeOrgName


# Specify the URL of the Edge management API.

# For a Cloud based installation of Edge, the URL is:

# https://api.enterprise.apigee.com/v1

# For a Private Cloud installation, it is in the form:

# http://ms_IP_or_DNS:8080/v1 or

# https://ms_IP_or_DNS:TLSport/v1

MGMT_URL=https://api.enterprise.apigee.com/v1


# The org admin credentials for the Edge organization in the form

# of Edge emailAddress:pword.

# The portal uses this information to connect to Edge.

DEVADMIN_USER=orgAdmin@myCorp.com

DEVADMIN_PWD=ORG_ADMIN_PASSWORD


# The PHP port.

# If omitted, it defaults to 8888.

PHP_FPM_PORT=8888


# Optionally configure the SMTP server used by the portal.

# If you do, the properties SMTPHOST and SMTPPORT are required.

# The others are optional with a default value as notated below.

# SMTP hostname. For example, for the Gmail server, use smtp.gmail.com.

SMTPHOST=smtp.gmail.com


# Set the SMTP protocol as "standard", "ssl", or "tls",

# where "standard" corresponds to HTTP.

# Note that in previous releases, this setting was controlled by the

# SMTPSSL property. That property has been deprecated.

SMTP_PROTOCOL="standard"


# SMTP port (usually 25).

# The value can be different based on the selected encryption protocol.

# For example, for Gmail, the port is 465 when using SSL and 587 for TLS.

SMTPPORT=25


# Username used for SMTP authentication, defaults is blank.

SMTPUSER=your@email.com


# Password used for SMTP authentication, default is blank.

SMTPPASSWORD=YOUR_EMAIL_PASSWORD

Custom Database (Name) for Portal

Script to create custom database name, user on PG node for developer portal

  • Create script name ‘customDatabaseforPortal.sql’
  • DB creation script content below
    • Note below details should be updated/replace as per Silent Config file ## DPConfigfile.txt in the script

Developer portal usernamePG name from DP install config

  • <PORTAL_USER_NAME> :PG_NAME
  • <PORTAL_DATABASE> : PG_USER
--Create PG ROLE

---------------------------

CREATE ROLE <PORTAL_USER_NAME> WITH LOGIN PASSWORD 'Apigee123!';

ALTER ROLE <PORTAL_USER_NAME> WITH PASSWORD 'Apigee123!';


--Alter Role

---------------------------

ALTER ROLE <PORTAL_USER_NAME> CREATEDB;

ALTER ROLE <PORTAL_USER_NAME> WITH LOGIN;

ALTER ROLE <PORTAL_USER_NAME> SUPERUSER;

ALTER ROLE <PORTAL_USER_NAME> CREATEROLE;

ALTER ROLE <PORTAL_USER_NAME> REPLICATION;

ALTER ROLE <PORTAL_USER_NAME> BYPASSRLS;


--Create Database

---------------------------

CREATE DATABASE <PORTAL_DATABASE>;

GRANT ALL PRIVILEGES ON DATABASE <PORTAL_DATABASE> TO <PORTAL_USER_NAME>;

Installation Steps

Install Postgres Database for DP

NOTE: Do not install the portal on the same servers as Apigee Edge.

The portal requires Postgres to be installed before you can install the portal.To install Postgres standalone:

  1. Install the Edge apigee-setup utility on the node using the internet or non-internet procedure. SeeInstall the Edge apigee-setup utility for more.
  2. Use config file mentioned in section#configuration file
  3. At the command prompt, run the setup script to install Postgres:

/opt/apigee/apigee-setup/bin/setup.sh -p pdb -f postgres_config_file

  1. The -p pdb option specifies to install Postgre. The configuration file must be accessible or readable by the "apigee" user.
  2. On Postgres node, run DB script to create custom database and user for developer portal as below
  • Step#1

Update DB script and replace <PORTAL_USER_NAME and <PORTAL_USER_NAME> as mentioned above

  • Step#2

Copy the DB script into Developer portal PG node under /opt/apigee/customer/application

  • Step#3

cd /opt/apigee/apigee-postgresql/pgsql/bin

Run below command

psql -h localhost -U apigee -p 5432 -f /opt/apigee/customer/application/customDatabaseforPortal.sql

  • Step#4

Validate by trying to login to PG Database

psql -h localhost -d custportal -U custuser

Install Developer portal

Before you can install the portal, be sure that you have done the following as described in above for configuring custom Postgres DB as a standalone or on Edge

To install the portal refer above config file and follow these instructions

Version history
Last update:
‎09-09-2018 02:04 PM
Updated by: