-
Notifications
You must be signed in to change notification settings - Fork 50
Setting up an ec2 ubuntu map server
SETTING UP UBUNTU 11.10 (Oneiric) EC2 INSTANCE
-
Log in at console.aws.amazon.com
-
Go to alestic.com and choose Ubuntu 11.10 Oneiric EBS boot (us-east-1)
-
Choose instance type Medium and availability zone us-east-1d.
-
Choose your keypair.
-
Create a security group called [clientname].
- We have opened ports 80, 22, 443, and 8133.
-
Launch your instance
CONFIGURE THE EC2 INSTANCE
-
Log into the server with ssh -i your-keypair ubuntu@public-dns (Make sure your in the .ssh directory)
-
sudo apt-get update
-
sudo apt-get upgrade --fix-missing
-
sudo apt-get install git --fix-missing
-
Get package tools: sudo apt-get install python-pip
INSTALLING MAPNIK
-
sudo apt-get update
-
Go to https://github.com/mapnik/mapnik/wiki/UbuntuInstallation
- To install the stable version of Mapnik 2.x: - sudo add-apt-repository ppa:mapnik/nightly-2.1 - sudo apt-get update - sudo apt-get install libmapnik mapnik-utils python-mapnik
-
Get TileStache set up: - sudo easy_install -U gunicorn - sudo apt-get install python-imaging - sudo pip install -U modestmaps - sudo pip install -U tilestache - sudo pip install -U cssutils -
sudo pip install -U cascadenik
-sudo apt-get install python-psycopg2 python-shapely
INSTALLING AND SETTING UP A POSTGIS-ENABLED POSTGRES DATABASE
-
sudo apt-get install postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 postgresql-9.1-postgis
-
Configure the Postgres database:
Test you can log in to the database with:
sudo -u postgres psql
Background reading: https://help.ubuntu.com/11.10/serverguide/C/postgresql.html
Edit the access permissions (or pico):
sudo vim /etc/postgresql/9.1/main/pg_hba.conf
Made this section all have
trust
at the line ends:# Database administrative login by Unix domain socket local all postgres trust # TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust # Allow replication connections from localhost, by a user with the
Then restart Postgrest so that takes effect: sudo /etc/init.d/postgresql restart
-
Set up your PostGIS template
Read: https://github.com/nvkelso/geo-how-to/wiki/PostGIS
Alternatively: http://wygoda.net/blog/postgis-template-database-ubuntu-1110/