Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install PostgreSQL and pgAdmin in RHEL 8

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to install PostgreSQL and pgAdmin in RHEL 8". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Pgadmin4 is an open source Web-based management tool for managing PostgreSQL databases. This is a Python-based Web application that uses the back-end flask framework and front-end HTML5,CSS3 and Bootstrap development. Pgadmin4 is a rewrite of Pgadmin 3, which is written in C + + and has the following remarkable features:

Pgadmin4 function

Exquisite web interface with beautiful icons and panels.

Fully responsive Web layout with dashboards for real-time monitoring

Real-time SQL query tool / editor with syntax highlighting

Powerful management dialogs and common task tools

Useful tips can help you get started

There's more.

In this article, you will learn how to install PostgreSQL and pagAdmin4 in server mode using the WSGI module on RHEL8, and the Apache web server runs on the back end.

Install PostgreSQL on RHEL 8

The first step in installing PgAdmin4 is to install the PostgreSQL database server. There are different versions of PostgreSQL in the Appstream repository. You can select by using the dnf package Manager to enable the preferred package.

To list the modules available for PostgreSQL, run the following command:

# dnf module list postgresql

List the modules of Postgresql

The output shows that three versions are available for download from the AppStream repository: versions 9.6, 10, and 12. We can also see that the default version is Postgresql 10 [d] indicated by the tag. This is what is installed by running the following command.

# dnf install postgresql-server

However, we will install the latest version, PostgreSQL 12. Therefore, we will enable the module and override the default module flow. To do this, run the command:

# dnf module enable postgresql:12

Enable the module for PostgreSQL

Once you have enabled the module for Postgresql 12, continue and install Postgresql 12 and its dependencies, as shown below.

# dnf install postgresql-server

Install PostgreSQL in RHEL 8

First, you need to create a database cluster. The cluster contains a collection of databases managed by the server instance. To create a database cluster, call the following command:

# postgresql-setup-initdb

If all goes well, you should get the output below.

Initialize the PostgreSQL database

After creating the cluster, you can now start and enable the PostgreSQL instance, as shown below:

# systemctl start postgresql # systemctl enable postgresql

To confirm that Postgresql is up and running, execute:

# systemctl status postgresql

Verify PostgreSQL statu

Install Pgadmin4 in RHEL 8

To install Pgadmin4, first add an external repository as shown below.

# rpm-I https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-1-1.noarch.rpm

Next, run the following command to install pgadmin4 in server mode.

# dnf install pgadmin4-web

Install Pgadmin4 in RHEL 8

Next, install the policycoreutils package, which provides the core utilities required by SELinux.

$sudo dnf install policycoreutils-python-utils

Install Python Policycoreutils in RHEL 8

After installation, run the Pgadmin4 installation script as shown in the figure. This will create a pgadmin user account, store and log directories, configure SELinux, and start the Apache Web server that will run pgAdmin4.

# / usr/pgadmin4/bin/setup-web.sh

When prompted, provide the required information, and then click'Y' to start the Apache Web server.

Run the Pgadmin installation script

If you are running a firewall, open port 80 to allow Web service traffic.

# firewall-cmd-add-port=80/tcp-permanent # firewall-cmd-reload

Next, configure SELinux, as follows:

# setsebool-P httpd_can_network_connect 1

To access pgadmin4, launch a browser and browse the displayed URL.

Http://server-ip/pgadmin4

Be sure to log in with the email address and password provided when you run the setup script.

Pgadmin4 login

As shown below, this will take you to the Pgadmin4 dashboard.

Pgadmin4 Control Home Page

This is how Pgadmin4 is installed in server mode. You can now use the SQL editor to create and manage PostgreSQL databases and monitor their performance using the provided dashboards.

That's all for "how to install PostgreSQL and pgAdmin in RHEL 8". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report