1. 程式人生 > 實用技巧 >記一次 Centos7 yum 安裝、配置 PgAdmin4

記一次 Centos7 yum 安裝、配置 PgAdmin4

、安裝 pgdg 資原始檔pgdg-centos11-11-2.noarch.rpm

  1. [root@pgadmin ~]#yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
  2. 或者
  3. [root@pgadmin ~]# wget https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
  4. [root@pgadmin ~]# rpm -ivh ./rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm

9、檢視可安裝版本

[root@pgadmin ~]# yum search pgadmin

如下圖:

10、安裝pgadmin4

[root@pgadmin ~]# yum install -y pgadmin4

結果如下圖:

11、複製並配置pgadmin4.conf 檔案

  1. [root@pgadmin ~]# mv /etc/httpd/conf.d/pgadmin4.conf.sample /etc/httpd/conf.d/pgadmin4.conf
  2. [root@pgadmin ~]# vim /etc/httpd/conf.d/pgadmin4.conf

加入內容

  1. <VirtualHost *:80>
  2. ServerName pgadmin.cn
  3. # 自帶內容
  4. </VirtualHost>

如下圖: