Difference between revisions of "Setting up geonode"

From stgo
Jump to: navigation, search
(Notes on installing PostGIS)
(Notes on installing PostGIS)
Line 35: Line 35:
 
*** and then...., I got again an error: ''update-alternatives: error: alternative pg_basebackup.1.gz can't be slave of psql.1.gz: it is a slave of postmaster.1.gz'', which send me to this page: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
 
*** and then...., I got again an error: ''update-alternatives: error: alternative pg_basebackup.1.gz can't be slave of psql.1.gz: it is a slave of postmaster.1.gz'', which send me to this page: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
 
* then add a Postgres/postgis port forwarding rule for port 5432
 
* then add a Postgres/postgis port forwarding rule for port 5432
* usage with '''Geonode''' as external db, after modification of "''/etc/geonode/local_settings.py''" may require to run <code>geonode syncdb --noinput --all </code> (and perhaps a tomcat7/apache2 restart?)
+
* usage with '''GeoNode''' as '''external PostgreSQL DB''', after modification of "''/etc/geonode/local_settings.py''" may require to run <code>geonode syncdb --noinput --all </code> (and perhaps a tomcat7/apache2 restart?)
  
 
===  '''accessing geonode postgres''' ===
 
===  '''accessing geonode postgres''' ===

Revision as of 20:02, 8 January 2014

>> return Cedeus IDE


This is the fast install from GeoNode.org Quickstart. Full install instructions, including installation of PostGIS, can be found in this Admin tutorial

  1. Install from PPA in Ubuntu 12.04 -> see http://docs.geonode.org/en/latest/intro/install.html
    • sudo add-apt-repository ppa:geonode/release . Note, if add-apt does not work (command not found) then do first sudo apt-get update && sudo apt-get install python-software-properties
    • sudo apt-get update
    • sudo apt-get install geonode (before I could run this I had do to do sudo apt-get install libtomcat7-java so that Tomcat6 will be removed and then I could install tomcat7 - which was needed to for GeoServer - used by GeoNode)
  2. Set the IP address and create a superuser (also described here: http://docs.geonode.org/en/latest/deploy/production.html)
    • sudo geonode-updateip 127.0.0.1 (Use the real IP if you have one)
    • geonode createsuperuser.
    • set GeoServer ProxyURL as described in the geonode install instructions. Use user admin with geoserver.
    • If starting up Apache results in the following message: "Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName.", Then do this
  3. Import data

Read the admin docs and also OSGeo Live DVD Quickstart tutorial

  • note, for assiging geoserver tomcat memory, do it for tomcat7 as described for tomcat6 (see OSGeo VM) using setenv.sh but in /usr/share/tomcat7/bin

Notes on installing PostGIS

install from source: see: http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1204src

  • To check if postgres exists, use which psql which should return the path. Then with the path I did /usr/bin/psql --version

to retrieve the version installed.

  • So, Postgres 9.1 was installed, but when I executed "psql" I got this: psql: FATAL: role "ssteinig" does not exist
  • Hence, I first had to creating my account as a user using sudo -u postgres createuser -s $USER (got this from here).
  • Now I could create a db using createdb mygeodb, and connect via commandline with psql -d mygeodb
  • Finally I spatially enabled the db with CREATE EXTENSION postgis; and CREATE EXTENSION postgis_topology;
  • then add a Postgres/postgis port forwarding rule for port 5432
  • usage with GeoNode as external PostgreSQL DB, after modification of "/etc/geonode/local_settings.py" may require to run geonode syncdb --noinput --all (and perhaps a tomcat7/apache2 restart?)

accessing geonode postgres

  • create user: sudo su - postgres
  • and: createuser -d -E -i -l -P -r -s sstein
  • to access via terminal use psql -U sstein -d geonode -h localhost
  • to access via pgAdmin:

some postgres command

  • quit psql: \q
  • connecting: psql -U geonode93 -d geonodegisdb93 -h localhost -p 5432
  • listing of dbs: psql -l -p 5432<code> or <code>\l(including spec of port, as the PostGIS VM has postgres 9.1 (:9434) and 9.3 (:9432) installed)
    • or alternatively: SELECT datname FROM pg_database WHERE datistemplate = false;
  • adding / removing users createuser and dropuser e.g.: dropuser geonode -p 5434 but needs to be done as "sudo su - postgres"
  • creating /removing dbs createdb and dropdb e.g.: createdb geonodegisdb93
  • listing of tables: \dt : but this will only list the table from the database currently connected to
    • to see at least something (if nothing added yet) it can also be done using: SELECT table_schema,table_name FROM information_schema.tables ORDER BY table_schema,table_name;