SlideShare a Scribd company logo
1 of 25
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

More Related Content

What's hot

Lamp configuration u buntu 10.04
Lamp configuration   u buntu 10.04Lamp configuration   u buntu 10.04
Lamp configuration u buntu 10.04mikehie
 
How To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on UbuntuHow To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on UbuntuVCP Muthukrishna
 
TFTP Installation Configuration Guide
TFTP Installation Configuration GuideTFTP Installation Configuration Guide
TFTP Installation Configuration GuideVCP 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 7How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7VCP Muthukrishna
 
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SANSaroj Sahu
 
How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7VCP Muthukrishna
 
Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4Varsha Technaureus
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7VCP Muthukrishna
 
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7VCP Muthukrishna
 
How To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load BalancerHow To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load BalancerVCP Muthukrishna
 
How To Install and Configure Apache SSL on CentOS 7
How To Install and Configure Apache SSL on CentOS 7How To Install and Configure Apache SSL on CentOS 7
How To Install and Configure Apache SSL on CentOS 7VCP Muthukrishna
 
Install odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debianInstall odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debianFrancisco Servera
 
How To Install and Configure Splunk on RHEL 7 in AWS
How To Install and Configure Splunk on RHEL 7 in AWSHow To Install and Configure Splunk on RHEL 7 in AWS
How To Install and Configure Splunk on RHEL 7 in AWSVCP Muthukrishna
 
How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04Vanda KANY
 
How to installation and configure apache2
How to installation and configure apache2How to installation and configure apache2
How to installation and configure apache2VCP Muthukrishna
 

What's hot (20)

Lamp configuration u buntu 10.04
Lamp configuration   u buntu 10.04Lamp configuration   u buntu 10.04
Lamp configuration u buntu 10.04
 
How To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on UbuntuHow To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on Ubuntu
 
TFTP Installation Configuration Guide
TFTP Installation Configuration GuideTFTP Installation Configuration Guide
TFTP Installation Configuration Guide
 
Web sockets
Web socketsWeb sockets
Web sockets
 
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 7How 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
 
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
 
How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7
 
Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4Installation Of Odoo 12 On Ubuntu 18.4
Installation Of Odoo 12 On Ubuntu 18.4
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
 
Jffnms Manual
Jffnms ManualJffnms Manual
Jffnms Manual
 
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
 
How To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load BalancerHow To Configure Amazon EC2 Load Balancer
How To Configure Amazon EC2 Load Balancer
 
How To Install and Configure Apache SSL on CentOS 7
How To Install and Configure Apache SSL on CentOS 7How To Install and Configure Apache SSL on CentOS 7
How To Install and Configure Apache SSL on CentOS 7
 
Apache
ApacheApache
Apache
 
How To Install CentOS 7
How To Install CentOS 7How To Install CentOS 7
How To Install CentOS 7
 
Install odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debianInstall odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debian
 
Squid file
Squid fileSquid file
Squid file
 
How To Install and Configure Splunk on RHEL 7 in AWS
How To Install and Configure Splunk on RHEL 7 in AWSHow To Install and Configure Splunk on RHEL 7 in AWS
How To Install and Configure Splunk on RHEL 7 in AWS
 
How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04
 
How to installation and configure apache2
How to installation and configure apache2How to installation and configure apache2
How to installation and configure apache2
 

Similar to Install PostgreSQL on CentOS

Postgresql quick guide
Postgresql quick guidePostgresql quick guide
Postgresql quick guideAshoka Vanjare
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseNikhil Kumar
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleChanaka Lasantha
 
Netxms install guide
Netxms install guideNetxms install guide
Netxms install guideNaga Raju N
 
Setup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platformSetup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platformAjeet Singh
 
Apache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdfApache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdfSkillAnything
 
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp022nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02shaikyunus1980
 
Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...
Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...
Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...ginniapps
 
How to install Setup & Configure SSH Jump Server on a Linux box
How to install Setup & Configure  SSH Jump Server on a Linux boxHow to install Setup & Configure  SSH Jump Server on a Linux box
How to install Setup & Configure SSH Jump Server on a Linux boxEzee Login
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guideSeungmin Shin
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationPASCAL Jean Marie
 
5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterp5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterpnvluan
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_trainingvideos
 

Similar to Install PostgreSQL on CentOS (20)

Postgresql quick guide
Postgresql quick guidePostgresql quick guide
Postgresql quick guide
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and Database
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmaple
 
Netxms install guide
Netxms install guideNetxms install guide
Netxms install guide
 
Setup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platformSetup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platform
 
Linux
LinuxLinux
Linux
 
Apache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdfApache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdf
 
RAC 12c
RAC 12cRAC 12c
RAC 12c
 
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp022nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
 
Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...
Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...
Discoverer 11.1.1.7 web logic (10.3.6) & ebs r12 12.1.3) implementation guide...
 
How to install Setup & Configure SSH Jump Server on a Linux box
How to install Setup & Configure  SSH Jump Server on a Linux boxHow to install Setup & Configure  SSH Jump Server on a Linux box
How to install Setup & Configure SSH Jump Server on a Linux box
 
Sun raysetup
Sun raysetupSun raysetup
Sun raysetup
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
 
mail server
mail servermail server
mail server
 
5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterp5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterp
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 

More from Rangson Sangboonruang

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

More from Rangson Sangboonruang (11)

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

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 

Recently uploaded (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 

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

  1. 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.