How To Install PostgreSQL 11 On CentOS 7
How To Install PostgreSQL 11 On CentOS 7
$ yum update -y
$ reboot
$ /usr/pgsql-11/bin/postgresql-11-setup initdb
Initializing database ... OK
Depending on the storage system used or allocated resources, the initialization may
take some time. The default directory where PostgreSQL will store data
is /var/lib/pgsql/11/data.
$ nano /var/lib/pgsql/11/data/postgresql.conf
listen_address = '*'
Also, we need to let PostgreSQL know to accept remote connections:
$ nano /var/lib/pgsql/11/data/pg_hba.conf
# Accept from anywhere
host all all 0.0.0.0/0 md5
Restart service after making configuration changes:
$ su - postgres
postgresql=$ psql -c "alter user postgres with password 'password'"
ALTER ROLE
postgresql=$
$ cp /etc/httpd/conf.d/pgadmin4.conf.sample /etc/httpd/conf.d/pgadmin4.conf
Step 10.3: Configure VirtualHost
Edit the Apache configuration file to add a VirtualHost as appears below:
<VirtualHost *:80>
ServerName pgadmin.example.com
LoadModule wsgi_module modules/mod_wsgi.so
WSGIDaemonProcess pgadmin processes=1 threads=25
WSGIScriptAlias /pgadmin4 /usr/lib/python2.7/site-packages/pgadmin4-
web/pgAdmin4.wsgi
<Directory /usr/lib/python2.7/site-packages/pgadmin4-web>
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
</VirtualHost>
$ python /usr/lib/python2.7/site-packages/pgadmin4-web/setup.py
When prompted, fill in the Email address and Password. This email address and
password will be used as login credential to access the pgAdmin web interface:
Setsebool -P httpd_can_network_connect 1