According to their homepage headline, PostgreSQL is world's most advanced open source relational database. More and more services here at Mimar rely on it, of which perhaps most popular would be GitLab, Synapse and Mattermost. While basic administrative tasks in PostgreSQL can be performed by means of interactive terminal, psql, most admins will find pgAdmin a better tool for the job. This article gives exact steps how to configure pgAdmin4 as web application hosted in Apache HTTP Server name-based VirtualHost on FreeBSD.

Conventions

Before we dive into installing and configuring stuff, here are a few introductory explanations:

  • It is assumed that user account under which installation will be performed has full sudo rights
  • Abovementioned user account has tcsh login shell
  • Commands which are performed as standard user will be prefixed with %
  • Commands which are performed in python virtualenv will be prefixed with [pgadmin4] %

Installation of prerequisite FreeBSD packages

Here are the packages we need to install as prerequisites:

% sudo pkg install  databases/postgresql11-client databases/py-sqlite3 devel/py-virtualenv www/apache24 www/mod_wsgi4

Previous Post