Skip to content

Instantly share code, notes, and snippets.

@yorzi
Forked from dstroot/install_postgresql.sh
Created May 22, 2017 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorzi/5f49c8ffab98a0167b1c278f6ac40df3 to your computer and use it in GitHub Desktop.
Save yorzi/5f49c8ffab98a0167b1c278f6ac40df3 to your computer and use it in GitHub Desktop.
Install PostgreSQL on Amazon AMI
#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/???
# chmod 777 install_postgresql.sh
# ./install_postgresql.sh
###############################################
echo "*****************************************"
echo " Installing PostgreSQL"
echo "*****************************************"
sudo yum -y install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo service postgresql initdb
# Use MD5 Authentication
sudo sed -i.bak -e 's/ident$/md5/' -e 's/peer$/md5/' /var/lib/pgsql9/data/pg_hba.conf
#start
sudo /sbin/chkconfig --levels 235 postgresql on
sudo service postgresql start
# http://imperialwicket.com/aws-install-postgresql-on-amazon-linux-quick-and-dirty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment