[手动选题][tech]: 20230301.0 ️ How to Install PgAdmin4 on RHEL 9 Step by Step.md (#28749)

This commit is contained in:
六开箱 2023-03-02 08:43:30 +08:00 committed by GitHub
parent 5b07c3e45e
commit bb3994ff94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,159 @@
[#]: subject: "How to Install PgAdmin4 on RHEL 9 Step by Step"
[#]: via: "https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/"
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install PgAdmin4 on RHEL 9 Step by Step
======
Pgadmin4is a free and opensource web-based administration and development platform for PostgreSQL. It interacts with PostgreSQL database server on both local and remote servers and displays server statistics using intuitive and interactive dashboards.
Pgadmin4 is a rewrite of Pgadmin 3 and provides the following notable features:
- A responsive web UI with intutive and real-time monitoring dashboards
- An improved web interface with cool and new panels and icons.
- An SQL query editor with syntax highlighting.
- Extensive documentation.
- Useful tips to help you get started.
In this guide, we will demonstrate how to install Pgadmin4 on RHEL 9.
##### Prerequisites
Before you begin, ensure that you have a RHEL 9 server instance with PostgreSQL database server installed. Check out guide on how to install PostgreSQL 15 on RHEL 9.
With PostgreSQL server installed, carry on with the following steps.
### Step 1) Add Pgadmin4 Repository on RHEL 9
The first step is to add the Pgadmin4 repository on RHEL 9. But first, install the EPEL repository which provides essential software packages.
```
$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
```
Next, install Pgadmin4s repository as follows.
```
$ sudo dnf install -y https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm
```
Once done, build a cache for Pgadmin4 and EPEL repositories as follows.
```
$ sudo dnf makecache
```
### Step 2) Install PgAdmin4 on RHEL 9
Once the Pgadmin4 and EPEL repositories are in place, proceed and install Pgadmin4 using the DNF package manager as shown.
```
$ sudo dnf install pgadmin4 -y
```
This installs a myriad of packages including Pgadmin4, Apache HTTP web servers, and Python packages to mention a few.
To confirm that Pgadmin4 has been installed, run the following command:
```
$ rpm -qi pgadmin4
```
This prints out quite some information including the name, version, release, and architecture of the installed package.
### Step 3) Start / Enable PgAdmin4 on RHEL 9
At this point, Pgadmin4 is successfully installed. However, you need to go a step further and get it running. To start the Pgadmin4 service, run the command:
```
$ sudo systemctl start httpd
```
Be sure also to enable the service to start every time the system boots.
```
$ sudo systemctl enable httpd
```
To confirm that Pgadmin4 is running run the command:
```
$ sudo systemctl status httpd
```
### Step 4) Initializing PgAdmin4 on RHEL 9
The Pgadmin4 package provides a configurable script for setting up the pgAdmin web service. This allows you to create a user account which is used to authenticate and configure SELinux policies and Apache web server.
Therefore, run the script as follows.
```
$ sudo /usr/pgadmin4/bin/setup-web.sh
```
Provide the email and password that you will use as login credentials on the login page.
NOTE:Sometimes, you may encounter a semanage: command not found error as shown in the output below. This indicates that the semanage package is missing.
Semanage, short for SELinux (Security-Enhanced Linux) policy management tool, is a utility used to configure some aspects of SELinux policy without requiring modification to or recompilation from policy sources.
To fix this error, you need to check for the package that provides semanage. You can do this by running the command:
```
$ sudo dnf provides /usr/sbin/semanage
```
From the output, you can see that semanage is provided by the  policycoreutils-python-utils-3.3-6.el9_0.noarch  package.
To install this package, run the following command.
```
$ sudo dnf install policycoreutils-python-utils -y
```
Once again, run the Pgadmn4 installation script as shown.  Provide the email address and password and type y when prompted.
```
$ sudo /usr/pgadmin4/bin/setup-web.sh
```
### Step 5) Access the Pgadmin4 Web Interface
At this point, Pgadmin4 is successfully installed. To access it from a web browser, head over to the following address:
http://server-ip/pgadmin4
You will get the following login web interface. Be sure to provide the Email and password you provided when running the installation script and click Login.
Once logged in, the Pgadmin4 dashboard will come to view as shown.
To add a server that can be administered by Pgadmin4, click Add New Server
On the General tab fill out the name of the server and add comments for better description.
Next, click Connection and fill out the Hostname/Address , Port , maintenance database , username and password. Then finally click Save.
Thereafter, you will see PosrgreSQL server statistics displayed on interactive and intuitive dashboards. On the left sidebar, you can browse various PostgreSQL parameters.
##### Conclusion
We hope you found this guide informative, kindly do post your queries and feedback in below comments section.
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/
作者:[Pradeep Kumar][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lkxed/