Changes between Version 13 and Version 14 of GeoDjangoUbuntuInstall
- Timestamp:
- Aug 17, 2008, 10:25:34 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GeoDjangoUbuntuInstall
v13 v14 5 5 The GeoDjangoInstall wiki describes in detail how to install GeoDjango dependencies from '''source''', which for many reasons is a great approach. 6 6 7 However, with the recent Ubuntu releases you can also use the '''Synaptic Package Manager''' (`apt-get install` on the command line) to handle the installation work for you.7 However, with Ubuntu releases you can also use the '''Synaptic Package Manager''' (`apt-get install` on the command line) to handle some of the installation work for you. In the next version of Ubuntu (8.10), it will likely be possible to install almost everything needed using Synaptic as libraries are updated. 8 8 9 9 * Note: if you take this route, be advised that the location of install directories will differ significantly from the source install approach. ie. PostGIS will be installed inside the PostgreSQL contrib and share directories specific to the PostgreSQL version number. 10 10 11 This writeup is based on Ubuntu 7.10. Any readers should update this document based on their experience from other versions.11 This writeup is based on Ubuntu 8.04 LTS. Any readers should update this document based on their experience from this version and note differences with newer versions. 12 12 13 13 == Short Version == 14 * Install Django from trunk 15 * Add the Ubuntu universe and multiverse debs 16 * Update and upgrade Ubuntu with Apt-get 17 * Easy_install Pycopg2 18 * If you need Postgres and Apache apt-get them 19 * make sure to grab the dev versions 20 * edit pg_hba.conf to allow django connections 21 * Apt-get postgis, libgdal, libgeos, and proj 14 * Install Django 1.0 or later 15 * Using apt-get or Synaptic, install apache2, python-psycopg2, postgresql, build-essential, libapache2-mod-python, postgresql-8.3-postgis 16 * Edit /etc/postgresql/8.3/main/pg_hba.conf to allow django connections 17 * Edit /etc/apache2/sites-available/default when creating your first GeoDjango app 18 * Download, compiles and install GDAL and GEOS libraries 19 * gdal-1.5.2.tar.gz from http://download.osgeo.org/gdal/ 20 * geos-3.0.0 from http://geos.refractions.net/downloads 22 21 * Create your PostGIS enabled PostgreSQL db 23 22 * Proceed with writing your first GeoDjango app … … 27 26 28 27 === Step 1 === 29 Add the universe and multiverse debian repositories 30 28 Install Needed Programs using apt-get or Synaptic 31 29 {{{ 32 #if you have the desktop edition 33 sudo gedit /etc/apt/sources.list 34 #if you have the server edition 35 sudo nano /etc/apt/sources.list 36 # if you know how to use vim, you probably don't need to be reading this page! 37 sudo vim /etc/apt/sources.list 38 ## Add these Universe / Multiverse sites to the bottom of the page 39 ## Make sure to specify the correct Ubuntu version 40 deb http://archive.ubuntu.com/ubuntu gutsy universe multiverse 41 deb-src http://archive.ubuntu.com/ubuntu gutsy universe multiverse 42 deb http://archive.ubuntu.com/ubuntu gutsy-security universe multiverse 43 deb-src http://archive.ubuntu.com/ubuntu gutsy-security universe multiverse 44 deb http://archive.ubuntu.com/ubuntu gutsy-updates universe multiverse 45 deb-src http://archive.ubuntu.com/ubuntu gutsy-updates universe multiverse 30 apt-get install apache2 python-psycopg2 postgresql build-essential libapache2-mod-python postgresql-8.3-postgis #Or install using Synaptic 46 31 }}} 47 32 48 33 === Step 2 === 49 Then upgrade and update ubuntu based on these new sources50 {{{51 apt-get update52 apt-get upgrade53 }}}54 34 55 === Step 3 ===56 Use easy_install to install psycopg257 {{{58 wget http://peak.telecommunity.com/dist/ez_setup.py59 sudo python ez_setup.py60 sudo easy_install psycopg261 }}}62 63 === Step 4 ===64 Install Apache and PostgreSQL (if you need them)65 {{{66 apt-get install apache2 apache2-threaded-dev apache2-doc apache2-mpm-prefork apache2-utils ssl-cert67 }}}68 {{{69 sudo apt-get install postgresql postgresql-contrib postgresql-server-dev-8.3 # or -8.270 }}}71 * Then make sure that the postgresql programs are on your path or in .bash_profile72 {{{73 Export PATH=/usr/lib/postgresql/8.3/bin/74 }}}75 35 * Open up access in the pg_hba.conf file 76 36 {{{ 77 sudo vim /etc/postgresql/8.3/main/pg_hba.conf37 sudo pico /etc/postgresql/8.3/main/pg_hba.conf #Alternatively use gedit or a text editor of your choice 78 38 # change ident sameuser to trust - WARNING SECURITY RISK 79 39 # comment out this line to allow, for instance, to django/psycopg2 to connect without password … … 87 47 88 48 89 === Step 5 === 90 Apt-get install postgis, libgdal, libgeos, and proj 91 * Note: search for the exact package names with 49 === Step 3 === 50 Download needed libraries that do not have new enough versions in Synaptic 92 51 {{{ 93 apt-cache search GIS_LIB_NAME 52 wget gdal-1.5.2.tar.gz http://download.osgeo.org/gdal/ 53 wget geos-3.0.0 http://geos.refractions.net/downloads 94 54 }}} 95 55 56 === Step 5 === 57 Compile and install these libraries so GeoDjango can find them 58 Extract gdal-1.5.2.tar.gz and geos-3.0.0 to folders on your Desktop and install:: 96 59 {{{ 97 apt-get install postgresql-8.3-postgis libgeos-dev libgeos-c1 libgdal1-dev proj 60 #in the gdal-1.5.2 directory 61 ./configure --datadir=/usr/local/share/gdal 62 make 63 sudo make install 64 65 #in the geos-3.0.0 directory 66 ./configure 67 make 68 sudo make install 69 70 sudo cp /home/[Your Username]/geos-3.0.0/capi/libs/* /usr/lib/ 71 sudo cp /usr/share/gdal/gcs.csv /usr/local/share/ 98 72 }}} 99 73 100 === Step 6===74 === Step 4 === 101 75 Create your PostGIS `template_postgis` database 102 76 {{{ … … 149 123 }}} 150 124 151 === Step 7===125 === Step 5 === 152 126 Return to GeoDjangoInstall for troubleshooting and tests for GDAL and GEOS (see bottom of page) 153 127 154 === Step 8===128 === Step 6 === 155 129 Check out [http://mapserver.gis.umn.edu/ MapServer], [http://mapnik.org/ Mapnik], and [http://openlayers.org/ OpenLayers], open source mapping applications recommended for use with !GeoDjango. 156 130 157 131 Install these and a few other helpful utilities with: 158 132 {{{ 159 sudo apt-get install cgi-mapserver mapserver-bin python-gdal python-mapscript gdal-bin133 sudo apt-get install cgi-mapserver python-gdal python-mapscript 160 134 }}}