edit

Cartoview

This document describes the Installation of Cartoview on ubunto with GeoNode 2.6.3

Warning

In case of any other version of GeoNode before 2.5 these steps will not be applicable.

Installation Requirements

  • Install Python2.7.

  • Install Django

    1
    2
    sudo apt-get update
    sudo apt-get install python-django
    

Note

For more information about Djano installation visit 1.8.7 <= Django <1.9a0.

Install Required Packages on ubuntu linux

  • Run the following command
    1
    2
     sudo apt-get update
     sudo apt-get install python-virtualenv python-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libpq-dev libgdal-dev git default-jdk
    

Database Installation

  • Install PostgreSQL Database

    1
    sudo apt-get install postgresql postgresql-contrib
    

  • Install PostGIS ( Extension to support Geographic objects that allows location queries to be run in SQL. )

    1
    sudo apt-get install postgis
    

Note

you can install pgAdmin ( PostgreSQL GUI tool using ): sudo apt-get install pgadmin3

Note

For more Information about PostgreSQL visit postgresql.

Database Configuration

  • You will need to log in with a user called postgres created by the installation to manage the database
    1
    sudo -i -u postgres
    
  • Change the postgres user password
    1
    2
    psql
    \password
    
  • Exit the PostgreSQL prompt by typing
    1
    \q
    
  • Create two new databases Cartoview and Cartoview_datastore
    1
    2
    createdb Cartoview
    createdb Cartoview_datastore
    

Note

You can change the databases' name but make sure to change thier names in the local_settings.py file in Cartoview project directory

  • Add PostGIS extension to the created databases
1
2
psql <database-name>
CREATE EXTENSION postgis;

Note

For more information about PostgreSQL configuration visit postgreSQL

Install GeoServer

  • Install Java 8 (needed by GeoServer)
    1
    2
    3
    sudo apt-add-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer
    

1) Download Tomcat v9

2) Extract the tar folder and rename it tomcat

3) Download GeoServer war file from here

4) Rename the war file to geoserver.war

5) Copy the war file inside webapps directory in tomcat

6) Create tomcat user by editing the tomcat-users.xml file:

1
        sudo nano path/to/tomcat/conf/tomcat-users.xml

Note

Make sure to change path/to/tomcat in the previous command with your tomcat path

7) Paste the following line in tomcat-users.xml <user username="admin" password="password"roles="manager-gui,admin-gui"/> just before </tomcat-users > and change the username and password

8) Edit context files in host-manager directory

1
 sudo nano path/to/tomcat/webapps/host-manager/META-INF/context.xml

9) Comment the line <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> by changing it to <!--<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />-->

10) Edit context files in manager directory

1
sudo nano path/to/tomcat/webapps/manager/META-INF/context.xml

11) Comment the line <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> by changing it to <!--<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />-->

  • Start tomcat server

sh path/to/your/tomcat/bin/startup.sh

  • Note

    For more information about tomcat Installation and Configuration of tomcat visit tomcat
  • Important

    Cartview must be up and running
  • Important

    In Production Configure GeoServer before uploading layers from here

GeoNode 2.6.3 Installation

  • Follow these setps if you don't have Geonode installed on your ubuntu system.

  • Create and activate the python virtual environment

    1
    2
    virtualenv <your_virtual_env_name>
    source <your_virtual_env_name>/bin/activate
    
  • Install pip ( a package management system used install and manage software packages written in Python )

    1
    sudo apt-get install python-pip
    
  • Install geonode 2.6.3

    1
    2
    pip install geonode==2.6.3
    sudo apt-get install python-gdal
    
  • Create a symbolic link of OSGeo in your virtualenv needed by GDAL to run properly

    1
    ln -s /usr/lib/python2.7/dist-packages/osgeo  <your_virtual_env_name>/lib/python2.7/site-packages/osgeo
    

Note

To Verify installation add any layer in [Geonode][1]

Cartoview Libraries Installation

  • Install Cartoview

    pip install cartoview

  • Install Cartoview_Django Project

    1
    django-admin.py startproject --template=https://github.com/cartologic/Cartoview-project-template/archive/master.zip --name django.env,uwsgi.ini,.bowerrc,server.py   
    
  • Go to your Project Folder

    1
       cd <your_project_name>
    
  • Detect changes in app_manager App

    1
       python manage.py makemigrations app_manager
    
  • Create account Table

    1
       python manage.py migrate account
    
  • Create Rest of tables :

    1
        python manage.py migrate
    
  • Load default User

    1
        python manage.py loaddata sample_admin.json
    
  • Load default oauth app

    1
       python manage.py loaddata json/default_oauth_apps.json
    
  • Test Development Server by running this Command :

    1
          python manage.py runserver 0.0.0.0:8000
    

Info

(Optional) if you want to override any variable settings (for example to change the database password ,name or hostname ) renamelocal_settings.py.sample to local_settings.py then override settings you want inside local_settings.py

Warning

Don't Forget to Change <your_project_name> to desired name.

Apps From GeoApp Market

  • To Install apps from GeoApp Market

  • Load Default Store

    python manage.py loaddata app_stores.json

  • Install nodejs and then install bower we need them to install app_manager dependencies

  • In this step we will install required files in your project folder type : bower install
  • Collect Required files type: ```

    python manage.py collectstatic --noinput - Now you Can Install Apps from [Geo App Market][2] - Go toappstab and clickmanage apps``` Button and install app you want

Deployment Notes

  • Important

    In Production Configure GeoServer before uploading layers from here
  • Important

    Once Cartoview is installed it is expected to install all apps from the App Store automatically At the moment Cartoview will fully support Apache server only For nginx deployments, Cartoview will be able to detect new apps and get the updates, how ever to apply the updates, web server restart will be required to complete the process Cartoview will not be able to restart nginx when new apps are installed. After you install or update apps from the app manager page you will need to restart nginx manually until this issue is addressed in the future

    • Follow these steps to get apps working on nginx
      • Collect static files using this commands python manage.py collectstatic --noinput
      • Restart server now you should restart server after installing any app