AWS postgresql remote host connection
2013-11-05
To connect and run PostgreSQL database for istsos in AWS ubuntu 12.04. As per istsos tutorial, specifying localhost in database credentials says the database is inactive and subsequent service creation will end up in error, saying the wrong database the PostgreSQL TCP/IP connection and access credentials has to change.
have to edit
sudo nano /etc/postgresql/9.1/main/postgresql.conf
file with linelisten_addresses ‘localhost’
tolisten_addresses ‘*’
andsudo nano /etc/postgresql/9.1/main/pg_hba.conf
file line ipv4 section IP address tohost all all 0.0.0.0/0 md5
the line#host all all 127.0.0.1/32 md5
has to be uncomment as above.then PostgreSQL has to be restarted by this comment
/etc/init.d/postgresql Restart
the aws security group also has to be changed for a credential for port number 5432 with allowable ip address. and the port for PostgreSQL is the AWS instance name given by AWS
based on
- https://github.com/snowplow/snowplow/wiki/Setting-up-PostgreSQL
- http://hackgeo.com/cloud-computing/amazon-web-services/configuring-postgresql-9-1-and-postgis-2-on-ubuntu-12-04-in-amazon-aws
- http://askubuntu.com/questions/50621/cannot-connect-to-postgresql-on-port-5432
- http://www.cyberciti.biz/faq/postgresql-remote-access-or-connection/