Name: dbInstallation
Owner: SpatialDev
Description: Simple and generic script to install a fresh Postgresql 9.3.0 with PostGIS 2.1 on Ubuntu 12.04
Created: 2013-09-11 22:02:09.0
Updated: 2015-12-16 23:56:40.0
Pushed: 2014-04-29 18:47:15.0
Size: 159
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Install a new database. Using PostgreSQL 9.3.0 and PostGIS 2.1.0
Instructions for setting up Postgres 9.3.0 and PostGIS 2.1.0 on Ubuntu 12.04 (EC2)
This version installs everything from the source packages includeing all the dependices on a fresh EC2.
sudo apt-get update
sudo apt-get -y upgrade
sudo wget http://anonscm.debian.org/loggerhead/pkg-postgresql/postgresql-common/trunk/download/head:/apt.postgresql.org.s-20130224224205-px3qyst90b3xp8zj-1/apt.postgresql.org.sh
sudo chmod 777 apt.postgresql.org.sh
--Note: if using 12.04 use:
sudo ./apt.postgresql.org.sh precise
--Note: if using 12.10 use
--sudo ./apt.postgresql.org.sh quantal
(hit enter)
sudo apt-get install postgresql-9.3 postgresql-contrib-9.3 postgresql-9.3-postgis-2.1 postgresql-9.3-postgis-scripts -y
sudo su postgres
psql
alter user postgres with password '<your password here>';
\q
exit
--or VI or VIM or whatever editor
sudo pico /etc/postgresql/9.3/main/postgresql.conf
--from this
#listen_addresses = ?localhost?
--to
listen_addresses = ?*?
sudo pico /etc/postgresql/9.3/main/pg_hba.conf
--add this line:
host all all 0.0.0.0/0 md5
sudo /etc/init.d/postgresql restart
sudo su postgres
psql
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
\q
exit
You should be good to go?.