phpPgAdmin is web-based client written in php for accessing and managing PostgreSQL databases. It provides very efficient way to work with databases on PostgreSQL like, create database, table, alter database, export/import database etc.
本文将帮助您在 CentOS 和 RedHat 系统上安装 phpPgAdmin。在安装之前,请确保服务器上安装了 Apache 和 PostgreSQL。如果您没有它们,请阅读我们的教程以了解如何安装它们。
在 CentOS、RHEL 和 Fedora 上安装 PostgreSQL
在 CentOS 和 RHEL 上安装 Apache MySQL PHP
第 1 步:添加 PostgreSQL 存储库
第一步是在系统中安装 postgres 存储库,使用以下网址之一下载存储库 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
步骤 2:使用 Yum 安装 phpPgAdmin
使用 yum 命令行工具安装 phpPgAdmin 软件包。
# yum install phpPgAdmin
步骤3:配置phpMyAdmin进行远程访问。
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>
第四步:重启Apache服务
重新启动 Apache 服务以重新加载新设置。
# service httpd restart
步骤5:在浏览器上访问phpPgAdmin。
现在您可以使用以下网址在浏览器中访问 phpPgAdmin。将 192.168.1.100 更改为您的服务器 IP。
http://192.168.1.100/phpPgAdmin/