In this tutorial we will show you how to install and configuration of phpPgAdmin on your CentOS 7 server. For those of you who didn’t know, PhpPgAdmin is a web application which is used to administer PostgreSQL databases. This project is an extension of PhpMyadmin and it was developed to ensure that all the features which are available to Mysql users are also available to PostgreSQL database users. It’s a very powerful open source tool which brings ease and flexibility to PostgreSQL lovers and currently it supports all the popular operating systems
This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation phpPgAdmin on a CentOS 7 server.
Install phpPgAdmin on CentOS 7
Step 1. First, you need to enable EPEL repository on your system.
1 2 3 | ## RHEL/CentOS 7 64-Bit ## # wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm # rpm -ivh epel-release-7-6.noarch.rpm |
Step 2. Install LAMP server.
A CentOS 7 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install required PHP modules:
1 | yuminstallphp-mysqlphp-gdphp-ldapphp-xmlphp-xmlrpcphp-mbstringphp-mcryptcurlphp-pgsql |
Step 3. Installing phpPgAdmin.
Install phpPgAdmin including php and the webserver. If the default httpd and php are already installed then the command will simply skip them:
1 2 | yumupdate yum-yinstallphpPgAdminphp-pgsql |
Step 4. Configure the firewall phpPgAdmin.
You need to modify the default firewall configuration before you can access phpPgAdmin from a web browser:
1 2 3 | firewall-cmd--zone=public--permanent--add-service=http firewall-cmd--zone=public--permanent--add-port=5432/tcp firewall-cmd--reload |
If selinux is enabled then you need to set selinux to allow httpd to connect to your database via network sockets:
1 2 | setsebool-Phttpd_can_network_connect_dbon setsebool-Phttpd_can_network_connecton |
Step 5. Configuring Apache web server for phpPgAdmin.
phpPgAdmin by default all allowed to access from localhost only. If you want to make it accessible from remote computers edit /etc/httpd/conf.d/phpPgAdmin.conf and update configure like below:
1 2 3 4 5 6 7 | Alias/phpPgAdmin/usr/share/phpPgAdmin <Directory/usr/share/phpPgAdmin> orderdeny,allow denyfromall allowfrom192.168.1.0/24 </Directory> |
Save and close the file. Restart the apache service for the changes to take effects:
1 | systemctlrestarthttpd.service |
Step 6. Accessing phpPgAdmin.
phpPgAdmin will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/phpPgAdmin/ or http://server-ip/phpPgAdmin/ and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.
Congratulation’s! You have successfully installed phpPgAdmin. Thanks for using this tutorial for installing phpPgAdmin on your CentOS 7 system. For additional help or useful information, we recommend you to check the official phpPgAdmin web site.