These notes are Slightly Modified(tm) from reprojected.com
First, ensure you have some base packages installed on your Ubuntu system:
- If you don't want to use the CD as a source for files, comment out the CDROM line (2nd or 3rd line) in /etc/apt/sources
- Install latest updates from the repository
sudo apt-get update sudo apt-get upgrade
- Install various programs of interest
sudo aptitude install ssh apache2 apache2-mpm-prefork \ python-psycopg2 build-essential bison flex unzip \ libreadline5-dev zlib1g-dev libgd2-xpm libxml2-dev libpam-ocaml-dev \ libgd2-xpm-dev libcurl3 libcurl3-dev libagg-dev python-dev \ doxygen aptitude install libapache2-mod-wsgi libxslt-dev \ libapache2-mod-python python-setuptools ipython \ subversion python-setuptools screen vim
Next, we'll install the GIS stack (mostly from source)
- All tarballs and packages to be located in: usr/local/src/package_name
- Proj.4 (Reprojection libraries)
cd /usr/local/src sudo wget ftp://ftp.remotesensing.org/proj/proj-4.7.0.tar.gz sudo wget ftp://ftp.remotesensing.org/proj/proj-datumgrid-1.5.zip sudo tar -xzvf proj-4.7.0.tar.gz cd proj-4.7.0 cd nad/ #ls cp ../../proj-datumgrid-1.5.zip . unzip proj-datumgrid-1.5.zip cd .. sudo ./configure sudo make sudo make install
- PostgreSQL v8.3
- Install postgres
sudo apt-get install postgresql-8.4 postgresql-server-dev-8.4
- Or, install postgres from source (not needed, or recommended unless you have a good reason)
- Install postgres
- modify /etc/postgresql/8.4/main/pg_hba.conf so you can log in as postgres w/o a password locally
- near the end, change the local METHOD to "trust" from "ident sameuser". Note this has negative security implications, especially if you ever plan to have folks other than yourself be logged into this machine.
- GEOS (Geometry Engine).
cd /usr/local/src sudo wget http://download.osgeo.org/geos/geos-3.2.2.tar.bz2 sudo tar -xjvf geos-3.2.2.tar.bz2 cd geos-3.2.2 sudo ./configure sudo make sudo make install
- GDAL/OGR (base Raster and Vector libraries)
cd /usr/local/src sudo wget http://download.osgeo.org/gdal/gdal-1.7.2.tar.gz sudo tar -xzf gdal-1.7.2.tar.gz cd gdal-1.7.2 sudo ./configure --with-geos --with-python sudo make ogr-all sudo make install
- PostGIS (spatial extensions for postgres)
- edit /etc/ld.so.conf to contain /usr/local/lib. Example file:
include /etc/ld.so.conf.d/*.conf /usr/local/lib
- run ldconfig to update, and then install postgis:
sudo ldconfig cd /usr/local/src sudo wget http://postgis.refractions.net/download/postgis-1.5.1.tar.gz sudo tar -xzvf postgis-1.5.1.tar.gz cd postgis-1.5.1 sudo ./configure sudo make sudo make install
- OPTIONAL: Create a gis enabled database
#create database called postgis createdb -U postgres postgis createlang -U postgres plpgsql postgis psql -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql -d postgis -U postgres psql -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql -d postgis -U postgres
- edit /etc/ld.so.conf to contain /usr/local/lib. Example file:
- Mapserver
- configure and make
cd /usr/local/src sudo wget http://download.osgeo.org/mapserver/mapserver-5.6.3.tar.gz sudo tar -xzf mapserver-5.6.3.tar.gz cd mapserver-5.6.3 sudo ./configure --with-ogr --with-gdal --with-httpd=/usr/sbin/apache2 --with-wms --with-wfsclient --with-wmsclient --with-curl-config --with-proj --with-tiff --with-gd --with-jpeg --with-agg --with-freetype --without-pdf --with-wcs --with-postgis sudo make
- test mapserv executable
/usr/local/src//mapserver-5.6.3/mapserv -v
- copy mapserv executable to the default cgi-bin to make it web-accessible
sudo cp /usr/local/src/mapserver-5.6.3/mapserv /usr/lib/cgi-bin
- configure and make
- GeoDjango trunk
cd /usr/local/src svn co http://code.djangoproject.com/svn/django/trunk/ django_trunk cd /usr/local/lib/python2.6/dist-packages sudo ln -s /usr/local/src/django_trunk/django/ django
- Misc
easy_install django-profiles django-registration
