phpPgAdmin is a web based administration tool for managing PostgreSQL database, it is very similar in look of phpMyAdmin. If you have a work experience on phpMyAdmin, you wont take much time in finding the way to work with. This guide will help you to setup phpPgAdmin on CentOS 7 / RHEL 7. Installing phpPgAdmin: Before installing, take a look at how to install PostgreSQL on CentOS 7. If you have followed PostgrqSQL install, you do not need to steup EPEL. Here is the link to setup EPEL repository on CentOS 7.
yum -y install phpPgAdmin php-pgsql httpd php
Configuring phpPgAdmin: Edit /etc/phpPgAdmin/config.inc.php file, we have to modify the admin file to enable the browser access. vi /etc/phpPgAdmin/config.inc.php
Add the localhost in the following server parameter.
$conf['servers'][0]['host'] = 'localhost';
If extra login security is true, then logins via phpPgAdmin with no password or certain usernames (pgsql, postgres, root, administrator) will be denied. To enable the postgres login, change it to false.
$conf['extra_login_security'] = false;
To simply hide other databases in the list make following condition to true – this does not in any way prevent your users from seeing other database by other means.
$conf['owned_only'] = true;
Configuring PostgreSQL: Modify config file to accept the authentication from the remote networks. vi /var/lib/pgsql/9.3/data/pg_hba.conf Please enter the value as per your requirements inIPv4 and Ipv6 connections and make sure it accepts md5 passwords.
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.2.0/24 md5
# IPv6 local connections:
host all all ::1/128 md5
Configuring Apche: By-default phpPgAdmin places the web config file in /etc/httpd/conf.d directory; it has the rules and access permission for the web access. In CentOS 7, web access is managed by mod_authz_core.c module; so normal allow or deny rules wont work even if you modify. vi /etc/httpd/conf.d/phpPgAdmin.conf Default config will look like below.
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Location /phpPgAdmin>
<IfModule mod_authz_core.c>
# Apache 2.4
Require local
#Require host example.com
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</IfModule>
</Location>
Please comment Require local and add Require all granted just below to commented line, it will look like below.
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Location /phpPgAdmin>
<IfModule mod_authz_core.c>
# Apache 2.4
# Require local
Require all granted
#Require host example.com
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</IfModule>
</Location>
PRACTICAL 2 .CREATION OF DOMAIN WITHOUT CONSTRAINT: Consider the following scenario on PostgreSQL 9.3: Step 1 .Create a domain with no constraints: postgres=# CREATE DOMAIN zipcode AS text; CREATE DOMAIN Step 2 .Add a named constraint: postgres=# ALTER DOMAIN zipcode ADD CONSTRAINT zipcheck CHECK (char_length(VALUE) = 3); ALTER DOMAIN Step 3 .Check the Domain whether created or not: postgres=# \dD List of domains Schema | Name | Type | Modifier | Check --------+-------------+------+----------+------------------------------------------------------------------ public | postal_code | text | | CHECK (VALUE ~ '^\d{5}$'::text OR VALUE ~ '^\d{5}-\d{4}$'::text) public | zipcode | text | | CHECK (char_length(VALUE) = 3) (2 rows) Step 4 .Ctreate a table using "zipcode" Data type postgres=# create table details (name...
Below tutorialdba.com collected and sorted out hundreds of universal License Keys for all major versions of VMware Workstation Pro (not for VMware Workstation Player) 4.x, 5.x, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x, 12.x and v14.x on Windows and Linux platforms (support both 32-bit and 64-bit operating system) in this single post. Besides, we also provide some license keys for VMware other projects. Just enjoy and share them. // 4~14 Universal License Keys // Version License Keys VMware Workstation VMware Workstation 4.x.x ZHDH1-UR90N-W844G-4PTN6 G1NP0-T88AL-M016F-4P8N2 ZC14J-4U16A-0A04G-4MEZP J1WF8-58LDE-881DG-4M8Q3 VMware Workstation 5.x.x LUXRM-WP0DN-A256U-4M9Q3 DJXDR-NDT27-Y2NDU-4YTZK DA925-HP80U-Z8HDC-4WXXP 3KW2W-AYR2C-88M6F-4MDQ2 VMware Workstation 6.x.x A0E8R-YUDFV-6AK2F-4GAN2 CRX0D-VWL0V-7CJ6C-46C7A NA8RX-QPNDU-D2LA9-4WAZL 1H4WM-N21FZ-7GK2A-44U5U 6AJ6N-THY2P-42KEF-4WTFG FK8R9-LPCDT-88H4Y-4WRN3 KAR8R-T8MAL-K8J6A-4WDXQ YJEKW-JMFF4-YA1DC-4WTQ...
Method 1 You can check the mode of the server using "pg_controldata". [pgsql@test~]$ pg_controldata /usr/local/pgsql/data84/ Database cluster state: in archive recovery --> This is Standby Database Database cluster state: in production --> This is Production Database [Master] Method 2 You can use pg_is_in_recovery() which returns True if recovery is still in progress(so the server is running in standby mode or slave) postgres=# select pg_is_in_recovery(); pg_is_in_recovery ------------------- t (1 row) If Return false so the server is running in primary mode or master postgres=# select pg_is_in_recovery(); pg_is_in_recovery ------------------- f (1 row)
If you are used to patch Oracle databases you probably know how to use opatch to apply PSUs. How does PostgreSQL handle this? Do we need to patch the existing binaries to apply security fixes? The answer is: No.Lets say you want to patch PostgreSQL from version 10.5/11.3 to version 10.10/11.5. This is called minor version postgres upgrade or postgres patching Why need to patch postgresql server ? Multiple SQL injection vulnerabilities have been discovered in PostgreSQL that could allow for arbitrary code execution. The vulnerabilities are the result of the application’s failure to sufficiently sanitize user-supplied input before using it in an SQL query. These vulnerabilities allow attackers with the CREATE permission (or Trigger permission in some tables) to exploit input sanitation vulnerabilities in the pg_upgrade and pg_dump functions. The CREATE permission is automatically given to new users on the public schema, and the public schema is the default schema used on the...
Database administration and management is required for any database on which there are continuous business transactions. If databases across enterprises are not monitored and maintained, then such databases are vulnerable to disasters, which eventually brings downtime to missions-critical application and, of course, it will incur losses in the business. Data is now one of the key assets for running a business, globally. Hence, it is one of the major responsibilities of enterprises to invest in resources for database monitoring and management. There are many database management and monitoring tools available for proactive database monitoring. In this article, we will look at PEM – “PostgreSQL Enterprise Manager” .Enterprise Manager, or PEM, is a graphical database management/monitoring tool that can help database administrators, system administrators, database developers, database managers, system architects, and performance analysts manage databases efficiently and proacti...
Comments
Post a Comment