SlideShare a Scribd company logo
Installation
Rangson Sangboonruang
rangson.sng@gmail.com
0
1
https://www.youtube.com/watch?v=yTsirtODBX8
You can find video demonstration on YouTube
 Update repository
 Creating a user group of sudoers
 Putting sudogroup in sudoer file
 Installing Postgresql
 Starting Postgresql Server
 Editing configuration files
 Connecting from local computer
 Connecting from other computers
 Configuring the firewall
Things to be covered
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
2
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
It is assumed that you already had CentOS
Installed. Let’s log on to CentOS.
3
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Updating repository
ls
- Download pgdg-redhat91-9.1-5.noarch.rpm from this urlo –
http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/pgdg-redhat91-9.1-5.noarch.rpm
1
- Place the file in your preferred directory, e.g. /tmp.
- Open Terminal window and go to /tmp.
cd /tmp
- List all the files in the directory to ensure that pgdg-
redhat91-9.1-5.noarch.rpm is already there.
- The screen shall display something like the following.
4
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
- Try updating repository.
rpm –Uvh pgdg-redhat91-9.1-5.noarch.rpm
Explanation:
You get this permission denied message because the user
you are logging on is not a privileged user. You can log
on using root but using root is not recommended because
root is super powerful and accidental damage can
potentially happen using root to perform admin tasks. On
CentOS you can use sudo to obtain supper user privilege
and the command will be like the following.
sudo rpm –Uvh pgdg-redhat91-9.1-5.noarch.rpm
5
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Explanation:
You get this message because the user you are using is not
listed in sudoers file. It is recommended that you create
a group called sudogroup (or anything you like) and add
the user you are using to this group and put the whole
group in sudoer file. To do all these, follow the
following steps.
6
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Creating a user group of sudoers
- From the menu bar choose System>Administration>Users and
Groups and you’ll be prompted to enter root’s password.
- For those you are familiar with Linux command line, you
can ignore this and perform the geek stuff.
2
7
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
- Now, you should see User Manager window. Click Add
Group button and enter the group name then click OK.
8
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
- Add your current user to “sudogroup” by choosing “Users”
tab, click Properties button (as highlighted). You
should see User Properties window. In the list box
scroll to the “sudogroup” and have it checked. Do not
forget to specify the Primary Group as “sudogroup”.
9
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Putting sudogroup in sudoer file
- Go back to Terminal window and type the following
command.
su root
Explanation:
“su” is used to switch user from one to another. Now you
are root. This is because to edit sudoer file you need
root’s privilege. Next command is as followed.
visudo
3
10
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Explanation:
The Terminal window is now a text editor called “vi”. Now
go through these steps
- Locate the cursor to the line that looks like
“root ALL=(ALL) ALL”.
- Press “i” on your keyboard insert text.
- Put “$sudogroup ALL=(ALL) ALL” underneath.
- Press “esc” on your keyboard then type :wq
- Press “Enter”
Explanation:
You have just exited the vi editor and are ready to
proceed the next step by typing the following command.
sudo rpm –Uvh pgdg-redhat91-9.1-5.noarch.rpm
11
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Explanation:
After running the previous command you should receive the
response like the above.
- Run the following command to list all available
Postgresql packages.
yum list postgresql*
12
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Installing Postgresql
Explanation:
Among all the listed packages the highlighted one is what
we are about to use for our installation.
- Type the following command
sudo yum install postgresql91-server.x86_64
4
13
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Explanation:
After running yum install you should see the screen like
the above and you’ll be prompted to say y (for yes) or n
(for no) to proceed downloading the package and finish
the installation.
- Type y for now and wait until the screen displays
“Complete!”
Explanation:
Now you have done with the installation. Next, let’s move
on to the next slide.
14
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Starting Postgresql Server
- Type the following command.
sudo service postgresql-9.1 start
Starting the server FAILED because you need to initialize
the database first. So let’s do it by typing the following
command.
sudo service postgresql-9.1 initdb
5
15
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
You are supposed to see the following screen.
Now try starting the server again. This time you should
see the following screen.
16
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Editing configuration files
- Type the following command to edit postgresql.conf
sudo vi /var/lib/pgsql/9.1/data/postgresql.conf
- Edit the file by changing these two lines:
Uncomment by removing #, and
Change from ‘localhost’ to ‘*’
Uncomment
6
17
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
- Type the following command to edit pg_hba.conf
sudo vi /var/lib/pgsql/9.1/data/pg_hba.conf
- Edit the file by changing these two lines:
Before
After
Insert
new
line
Change from
“indent” to
“md5”
The new line added contains the network address of you machine. This is to allow other
computer to connect to your sever.
18
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
- Type the following command to restart the server.
sudo service postgresql-9.1 restart
- If successful you should see the following.
- Type the following command to test your server.
sudo su postgres
createdb test
psql test
Explanation:
You should see this screen after running
the command above.
sudo su postgres => To switch to user
postgres
createdb test => To create a database
called test
psql test => To login to test database
<<Successful screen>>
19
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Connecting from local computer
- Type the following command to crate a role for the
database.
CREATE ROLE testuser WITH SUPERUSER LOGIN PASSWORD ‘test’;
- Type the following command to test the connection to the
server.
psql -h localhost –U testuser test
- Type the following command to exit test database
q
<<Successful screen>>
7
20
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Connecting from other computers
Explanation:
I used pgAdmin III to connect to the Postgresql Server.
And, first, failed to connect saying the server was not
listening on port 5432. Of cause, there is something you
have to do with the server.
8
21
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
Configuring the firewall (iptables)
- Type the following command to exit test database
q
- Type the following command to exit from postgres
exit
<<Successful screen>>
9
22
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
- Type the following command to edit iptables
sudo vi /etc/sysconfig/iptables
Insert this line
(before –A INPUT –j
Reject….).
23
Installation of Postgresql on CentOS
Postgresql Sever 9.1 and CentOS 6.5
- Type the following command to edit restart the firewall
sudo service iptables restart
<<Successful screen>>
- Try connecting to the server from other computer again.
This time you
should be able
to connect to
the server.
24
Ad

Recommended

DNF Failed To Open Cache
DNF Failed To Open Cache
VCP Muthukrishna
 
How to Install MariaDB Server or MySQL Server on CentOS 7
How to Install MariaDB Server or MySQL Server on CentOS 7
VCP Muthukrishna
 
How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7
VCP Muthukrishna
 
How To Install and Configure Screen on CentOS 7
How To Install and Configure Screen on CentOS 7
VCP Muthukrishna
 
How To Protect SSH Access with Fail2Ban on RHEL 7
How To Protect SSH Access with Fail2Ban on RHEL 7
VCP Muthukrishna
 
How to Upgrade Openfire on CentOS 7
How to Upgrade Openfire on CentOS 7
VCP Muthukrishna
 
Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7
VCP Muthukrishna
 
How To Install and Configure GNome on CentOS 7
How To Install and Configure GNome on CentOS 7
VCP Muthukrishna
 
Lamp configuration u buntu 10.04
Lamp configuration u buntu 10.04
mikehie
 
How To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on Ubuntu
VCP Muthukrishna
 
TFTP Installation Configuration Guide
TFTP Installation Configuration Guide
VCP Muthukrishna
 
Web sockets
Web sockets
bodokaiser
 
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
VCP Muthukrishna
 
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
Saroj Sahu
 
How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7
VCP Muthukrishna
 
Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4
Varsha Technaureus
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
VCP Muthukrishna
 
Jffnms Manual
Jffnms Manual
Rosemberth Rodriguez
 
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
VCP Muthukrishna
 
How To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load Balancer
VCP Muthukrishna
 
How To Install and Configure Apache SSL on CentOS 7
How To Install and Configure Apache SSL on CentOS 7
VCP Muthukrishna
 
Apache
Apache
Mindtree
 
How To Install CentOS 7
How To Install CentOS 7
VCP Muthukrishna
 
Install odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debian
Francisco Servera
 
Squid file
Squid file
Nalin Peiris
 
How To Install and Configure Splunk on RHEL 7 in AWS
How To Install and Configure Splunk on RHEL 7 in AWS
VCP Muthukrishna
 
How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04
Vanda KANY
 
How to installation and configure apache2
How to installation and configure apache2
VCP Muthukrishna
 
OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQL
Open Gurukul
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
chinkshady
 

More Related Content

What's hot (20)

Lamp configuration u buntu 10.04
Lamp configuration u buntu 10.04
mikehie
 
How To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on Ubuntu
VCP Muthukrishna
 
TFTP Installation Configuration Guide
TFTP Installation Configuration Guide
VCP Muthukrishna
 
Web sockets
Web sockets
bodokaiser
 
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
VCP Muthukrishna
 
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
Saroj Sahu
 
How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7
VCP Muthukrishna
 
Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4
Varsha Technaureus
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
VCP Muthukrishna
 
Jffnms Manual
Jffnms Manual
Rosemberth Rodriguez
 
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
VCP Muthukrishna
 
How To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load Balancer
VCP Muthukrishna
 
How To Install and Configure Apache SSL on CentOS 7
How To Install and Configure Apache SSL on CentOS 7
VCP Muthukrishna
 
Apache
Apache
Mindtree
 
How To Install CentOS 7
How To Install CentOS 7
VCP Muthukrishna
 
Install odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debian
Francisco Servera
 
Squid file
Squid file
Nalin Peiris
 
How To Install and Configure Splunk on RHEL 7 in AWS
How To Install and Configure Splunk on RHEL 7 in AWS
VCP Muthukrishna
 
How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04
Vanda KANY
 
How to installation and configure apache2
How to installation and configure apache2
VCP Muthukrishna
 
Lamp configuration u buntu 10.04
Lamp configuration u buntu 10.04
mikehie
 
How To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on Ubuntu
VCP Muthukrishna
 
TFTP Installation Configuration Guide
TFTP Installation Configuration Guide
VCP Muthukrishna
 
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
VCP Muthukrishna
 
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
Saroj Sahu
 
How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7
VCP Muthukrishna
 
Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4
Varsha Technaureus
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
VCP Muthukrishna
 
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
VCP Muthukrishna
 
How To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load Balancer
VCP Muthukrishna
 
How To Install and Configure Apache SSL on CentOS 7
How To Install and Configure Apache SSL on CentOS 7
VCP Muthukrishna
 
Install odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debian
Francisco Servera
 
How To Install and Configure Splunk on RHEL 7 in AWS
How To Install and Configure Splunk on RHEL 7 in AWS
VCP Muthukrishna
 
How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04
Vanda KANY
 
How to installation and configure apache2
How to installation and configure apache2
VCP Muthukrishna
 

Similar to Install PostgreSQL on CentOS (20)

OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQL
Open Gurukul
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
chinkshady
 
Installing Postgres on Linux
Installing Postgres on Linux
EDB
 
linux installation.pdf
linux installation.pdf
MuhammadShoaibHussai2
 
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Citus Data
 
Newgenlib Installation on Ubuntu 12.04
Newgenlib Installation on Ubuntu 12.04
Rajendra Singh
 
Postgres 12 Cluster Database operations.
Postgres 12 Cluster Database operations.
Vijay Kumar N
 
Domino9on centos6
Domino9on centos6
a8us
 
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis
 
Postgresql quick guide
Postgresql quick guide
Ashoka Vanjare
 
Installing & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOS
Devin Olson
 
Learning postgresql
Learning postgresql
DAVID RAUDALES
 
Setting Up a Cloud Server - Part 1 - Transcript.pdf
Setting Up a Cloud Server - Part 1 - Transcript.pdf
ShaiAlmog1
 
0292-introduction-postgresql.pdf
0292-introduction-postgresql.pdf
Mustafa Keskin
 
2.4.0 software installation v2
2.4.0 software installation v2
Acácio Oliveira
 
Perl Programming - 04 Programming Database
Perl Programming - 04 Programming Database
Danairat Thanabodithammachari
 
Oracle forms and reports 11g installation on linux
Oracle forms and reports 11g installation on linux
Venu Palakolanu
 
101 2.4a apend software installation v2
101 2.4a apend software installation v2
Acácio Oliveira
 
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
ceconidjeri
 
Software management in linux
Software management in linux
nejadmand
 
OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQL
Open Gurukul
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
chinkshady
 
Installing Postgres on Linux
Installing Postgres on Linux
EDB
 
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Citus Data
 
Newgenlib Installation on Ubuntu 12.04
Newgenlib Installation on Ubuntu 12.04
Rajendra Singh
 
Postgres 12 Cluster Database operations.
Postgres 12 Cluster Database operations.
Vijay Kumar N
 
Domino9on centos6
Domino9on centos6
a8us
 
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis
 
Postgresql quick guide
Postgresql quick guide
Ashoka Vanjare
 
Installing & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOS
Devin Olson
 
Setting Up a Cloud Server - Part 1 - Transcript.pdf
Setting Up a Cloud Server - Part 1 - Transcript.pdf
ShaiAlmog1
 
0292-introduction-postgresql.pdf
0292-introduction-postgresql.pdf
Mustafa Keskin
 
2.4.0 software installation v2
2.4.0 software installation v2
Acácio Oliveira
 
Oracle forms and reports 11g installation on linux
Oracle forms and reports 11g installation on linux
Venu Palakolanu
 
101 2.4a apend software installation v2
101 2.4a apend software installation v2
Acácio Oliveira
 
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
ceconidjeri
 
Software management in linux
Software management in linux
nejadmand
 
Ad

More from Rangson Sangboonruang (11)

ฝึกออกเสียงภาษาอังกฤษยังไงให้เป๊ะชัดเวอร์
ฝึกออกเสียงภาษาอังกฤษยังไงให้เป๊ะชัดเวอร์
Rangson Sangboonruang
 
ประโยคขั้นเทพ 5: ประโยความซ้อน (Relative Clauses)
ประโยคขั้นเทพ 5: ประโยความซ้อน (Relative Clauses)
Rangson Sangboonruang
 
ประโยคขั้นเทพ 4: อนุประโยค (Clauses)
ประโยคขั้นเทพ 4: อนุประโยค (Clauses)
Rangson Sangboonruang
 
ประโยคขั้นเทพ 3: Infinitive และ -ing Form
ประโยคขั้นเทพ 3: Infinitive และ -ing Form
Rangson Sangboonruang
 
ประโยคขั้นเทพ 2: กริยาวิเศษ (Adverbs)
ประโยคขั้นเทพ 2: กริยาวิเศษ (Adverbs)
Rangson Sangboonruang
 
ประโยคขั้นเทพ 1: เรื่องของกรรม (Objects)
ประโยคขั้นเทพ 1: เรื่องของกรรม (Objects)
Rangson Sangboonruang
 
โปแกรม Excel ทำใบเสร็จ แจ้งหนี้ เสนอราคา
โปแกรม Excel ทำใบเสร็จ แจ้งหนี้ เสนอราคา
Rangson Sangboonruang
 
กริยาช่องที่ 3 (Present Perfect และ Present Perfect Continuous)
กริยาช่องที่ 3 (Present Perfect และ Present Perfect Continuous)
Rangson Sangboonruang
 
เอกสารที่ฟรีแลนซ์หมือใหม่ต้องใช้เก็บเงินลูกค้า
เอกสารที่ฟรีแลนซ์หมือใหม่ต้องใช้เก็บเงินลูกค้า
Rangson Sangboonruang
 
ฝึกการออกเสียง "TH"
ฝึกการออกเสียง "TH"
Rangson Sangboonruang
 
คิดเลขประถมเป็นภาษาอังกฤษ
คิดเลขประถมเป็นภาษาอังกฤษ
Rangson Sangboonruang
 
ฝึกออกเสียงภาษาอังกฤษยังไงให้เป๊ะชัดเวอร์
ฝึกออกเสียงภาษาอังกฤษยังไงให้เป๊ะชัดเวอร์
Rangson Sangboonruang
 
ประโยคขั้นเทพ 5: ประโยความซ้อน (Relative Clauses)
ประโยคขั้นเทพ 5: ประโยความซ้อน (Relative Clauses)
Rangson Sangboonruang
 
ประโยคขั้นเทพ 4: อนุประโยค (Clauses)
ประโยคขั้นเทพ 4: อนุประโยค (Clauses)
Rangson Sangboonruang
 
ประโยคขั้นเทพ 3: Infinitive และ -ing Form
ประโยคขั้นเทพ 3: Infinitive และ -ing Form
Rangson Sangboonruang
 
ประโยคขั้นเทพ 2: กริยาวิเศษ (Adverbs)
ประโยคขั้นเทพ 2: กริยาวิเศษ (Adverbs)
Rangson Sangboonruang
 
ประโยคขั้นเทพ 1: เรื่องของกรรม (Objects)
ประโยคขั้นเทพ 1: เรื่องของกรรม (Objects)
Rangson Sangboonruang
 
โปแกรม Excel ทำใบเสร็จ แจ้งหนี้ เสนอราคา
โปแกรม Excel ทำใบเสร็จ แจ้งหนี้ เสนอราคา
Rangson Sangboonruang
 
กริยาช่องที่ 3 (Present Perfect และ Present Perfect Continuous)
กริยาช่องที่ 3 (Present Perfect และ Present Perfect Continuous)
Rangson Sangboonruang
 
เอกสารที่ฟรีแลนซ์หมือใหม่ต้องใช้เก็บเงินลูกค้า
เอกสารที่ฟรีแลนซ์หมือใหม่ต้องใช้เก็บเงินลูกค้า
Rangson Sangboonruang
 
ฝึกการออกเสียง "TH"
ฝึกการออกเสียง "TH"
Rangson Sangboonruang
 
คิดเลขประถมเป็นภาษาอังกฤษ
คิดเลขประถมเป็นภาษาอังกฤษ
Rangson Sangboonruang
 
Ad

Recently uploaded (20)

What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
Nice Dream.pdf /
Nice Dream.pdf /
ErinUsher3
 
The Man In The Back – Exceptional Delaware.pdf
The Man In The Back – Exceptional Delaware.pdf
dennisongomezk
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
“THE BEST CLASS IN SCHOOL”. _
“THE BEST CLASS IN SCHOOL”. _
Colégio Santa Teresinha
 
FIRST DAY HIGH orientation for mapeh subject in grade 10.pptx
FIRST DAY HIGH orientation for mapeh subject in grade 10.pptx
GlysdiEelesor1
 
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
penafloridaarlyn
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
Nice Dream.pdf /
Nice Dream.pdf /
ErinUsher3
 
The Man In The Back – Exceptional Delaware.pdf
The Man In The Back – Exceptional Delaware.pdf
dennisongomezk
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
FIRST DAY HIGH orientation for mapeh subject in grade 10.pptx
FIRST DAY HIGH orientation for mapeh subject in grade 10.pptx
GlysdiEelesor1
 
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
penafloridaarlyn
 

Install PostgreSQL on CentOS

  • 3.  Update repository  Creating a user group of sudoers  Putting sudogroup in sudoer file  Installing Postgresql  Starting Postgresql Server  Editing configuration files  Connecting from local computer  Connecting from other computers  Configuring the firewall Things to be covered Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 2
  • 4. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 It is assumed that you already had CentOS Installed. Let’s log on to CentOS. 3
  • 5. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Updating repository ls - Download pgdg-redhat91-9.1-5.noarch.rpm from this urlo – http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/pgdg-redhat91-9.1-5.noarch.rpm 1 - Place the file in your preferred directory, e.g. /tmp. - Open Terminal window and go to /tmp. cd /tmp - List all the files in the directory to ensure that pgdg- redhat91-9.1-5.noarch.rpm is already there. - The screen shall display something like the following. 4
  • 6. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 - Try updating repository. rpm –Uvh pgdg-redhat91-9.1-5.noarch.rpm Explanation: You get this permission denied message because the user you are logging on is not a privileged user. You can log on using root but using root is not recommended because root is super powerful and accidental damage can potentially happen using root to perform admin tasks. On CentOS you can use sudo to obtain supper user privilege and the command will be like the following. sudo rpm –Uvh pgdg-redhat91-9.1-5.noarch.rpm 5
  • 7. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Explanation: You get this message because the user you are using is not listed in sudoers file. It is recommended that you create a group called sudogroup (or anything you like) and add the user you are using to this group and put the whole group in sudoer file. To do all these, follow the following steps. 6
  • 8. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Creating a user group of sudoers - From the menu bar choose System>Administration>Users and Groups and you’ll be prompted to enter root’s password. - For those you are familiar with Linux command line, you can ignore this and perform the geek stuff. 2 7
  • 9. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 - Now, you should see User Manager window. Click Add Group button and enter the group name then click OK. 8
  • 10. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 - Add your current user to “sudogroup” by choosing “Users” tab, click Properties button (as highlighted). You should see User Properties window. In the list box scroll to the “sudogroup” and have it checked. Do not forget to specify the Primary Group as “sudogroup”. 9
  • 11. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Putting sudogroup in sudoer file - Go back to Terminal window and type the following command. su root Explanation: “su” is used to switch user from one to another. Now you are root. This is because to edit sudoer file you need root’s privilege. Next command is as followed. visudo 3 10
  • 12. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Explanation: The Terminal window is now a text editor called “vi”. Now go through these steps - Locate the cursor to the line that looks like “root ALL=(ALL) ALL”. - Press “i” on your keyboard insert text. - Put “$sudogroup ALL=(ALL) ALL” underneath. - Press “esc” on your keyboard then type :wq - Press “Enter” Explanation: You have just exited the vi editor and are ready to proceed the next step by typing the following command. sudo rpm –Uvh pgdg-redhat91-9.1-5.noarch.rpm 11
  • 13. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Explanation: After running the previous command you should receive the response like the above. - Run the following command to list all available Postgresql packages. yum list postgresql* 12
  • 14. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Installing Postgresql Explanation: Among all the listed packages the highlighted one is what we are about to use for our installation. - Type the following command sudo yum install postgresql91-server.x86_64 4 13
  • 15. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Explanation: After running yum install you should see the screen like the above and you’ll be prompted to say y (for yes) or n (for no) to proceed downloading the package and finish the installation. - Type y for now and wait until the screen displays “Complete!” Explanation: Now you have done with the installation. Next, let’s move on to the next slide. 14
  • 16. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Starting Postgresql Server - Type the following command. sudo service postgresql-9.1 start Starting the server FAILED because you need to initialize the database first. So let’s do it by typing the following command. sudo service postgresql-9.1 initdb 5 15
  • 17. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 You are supposed to see the following screen. Now try starting the server again. This time you should see the following screen. 16
  • 18. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Editing configuration files - Type the following command to edit postgresql.conf sudo vi /var/lib/pgsql/9.1/data/postgresql.conf - Edit the file by changing these two lines: Uncomment by removing #, and Change from ‘localhost’ to ‘*’ Uncomment 6 17
  • 19. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 - Type the following command to edit pg_hba.conf sudo vi /var/lib/pgsql/9.1/data/pg_hba.conf - Edit the file by changing these two lines: Before After Insert new line Change from “indent” to “md5” The new line added contains the network address of you machine. This is to allow other computer to connect to your sever. 18
  • 20. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 - Type the following command to restart the server. sudo service postgresql-9.1 restart - If successful you should see the following. - Type the following command to test your server. sudo su postgres createdb test psql test Explanation: You should see this screen after running the command above. sudo su postgres => To switch to user postgres createdb test => To create a database called test psql test => To login to test database <<Successful screen>> 19
  • 21. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Connecting from local computer - Type the following command to crate a role for the database. CREATE ROLE testuser WITH SUPERUSER LOGIN PASSWORD ‘test’; - Type the following command to test the connection to the server. psql -h localhost –U testuser test - Type the following command to exit test database q <<Successful screen>> 7 20
  • 22. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Connecting from other computers Explanation: I used pgAdmin III to connect to the Postgresql Server. And, first, failed to connect saying the server was not listening on port 5432. Of cause, there is something you have to do with the server. 8 21
  • 23. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 Configuring the firewall (iptables) - Type the following command to exit test database q - Type the following command to exit from postgres exit <<Successful screen>> 9 22
  • 24. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 - Type the following command to edit iptables sudo vi /etc/sysconfig/iptables Insert this line (before –A INPUT –j Reject….). 23
  • 25. Installation of Postgresql on CentOS Postgresql Sever 9.1 and CentOS 6.5 - Type the following command to edit restart the firewall sudo service iptables restart <<Successful screen>> - Try connecting to the server from other computer again. This time you should be able to connect to the server. 24

Editor's Notes

  • #2: Hello everyone. My name is Rangson Sangboonruang. This is, sort of, my second video I’ve ever posted to Youtube and I’m doing this to demonstrate one easy way to install PostgreSQL one of the most popular open source operating system, CentOS. Before we proceed I hope that you already have CentOS with X window installed on your machine. If not, please download it from available sources and get it installed.