如何使用Yum在CentOS和RHEL上安装phpPgAdmin

时间:2019-05-19 01:26:22  来源:igfitidea点击:

phpPgAdmin是用php编写的基于web的客户端,用于访问和管理PostgreSQL数据库。
它为PostgreSQL上的数据库提供了非常有效的工作方式,如创建数据库、表、修改数据库、导出/导入数据库等。
本文将在CentOS和RedHat系统上安装phpPgAdmin。
在安装之前,请确保在服务器上安装了Apache和PostgreSQL。

第一步:添加PostgreSQL存储库

第一步是在系统中安装postgres repository,使用下面的url下载repository rpm。

CentOS/RHEL 5, 32-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-5-i386/pgdg-centos91-9.1-4.noarch.rpm

CentOS/RHEL 6, 32-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-6-i386/pgdg-centos91-9.1-4.noarch.rpm

CentOS/RHEL 5, 64-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-5.0-x86_64//pgdg-centos91-9.1-4.noarch.rpm

CentOS/RHEL 6, 64-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-6.3-x86_64/pgdg-centos91-9.1-4.noarch.rpm

第二步:使用Yum安装phpPgAdmin

使用yum命令行工具安装phpPgAdmin包。

# yum install phpPgAdmin

第三步:配置phpPgAdmin,远程访问。

默认都只允许从本地主机访问。
如果我们想从远程计算机访问它,请编辑/etc/httpd/conf.d/phpPgAdmin.conf并像下面这样更新配置。

Alias /phpPgAdmin /usr/share/phpPgAdmin

<Directory /usr/share/phpPgAdmin>
   order deny,allow
   deny from all
   allow from 192.168.1.0/24
</Directory>

步骤4:重启Apache服务

重新启动Apache服务以重新加载新的设置。

# service httpd restart

第五步:在浏览器上访问phpPgAdmin。

现在我们可以使用以下url在浏览器中访问phpPgAdmin。

http://192.168.1.100/phpPgAdmin/