GeoNode Virtual Machine Structure

The Virtual Machine is based on a distribution of:

  • Ubuntu 20.04.2 LTS (codename Focal) Desktop 64-bit

It has been installed with a minimal set of dependencies, except the ones required by the GeoNode installation.

System and Application Users’ Credentials

Username

Password

Type

geonode-vm-321

geonode

System user with root power

admin

admin

GeoNode default superuser

admin

geoserver

GeoServer default admin (internal)

postgres

Postgresql 13 default superuser

geonode

geonode

Postgresql 13 geonode DB owner

geonode

geonode

Postgresql 13 geonode_data DB owner

Changing Screen Resolution and Keyboard Type

Screen Resolution

  • You can change the screen resolution by clicking with the mouse right button to the desktop and selecting the Display Settings menu image

  • Select the desired resolution from the dropdown selector and then click on Apply image

Keyboard Layout

  • You can change the screen resolution by clicking with the mouse right button to the desktop and selecting the Settings menu image

  • Clck on the plus button image

  • Click on the vertical points image

  • If you don’t find the desired language, click on the Other button image

  • Search and select the desired language from the list and click on the Add button image

  • Drag & drop the desired language to the top and delete the others image

System Services and Log files

Postgresql 13 DBMS

This GeoNode installation relies on a DB hosted by an instance of Postgresql 13 service, with the PostGIS Extensions.

Start and Stop the Service

  • In order to check the service status run:

    sudo systemctl status postgresql

    The system will print something like:

    ● postgresql.service - PostgreSQL RDBMS
       Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
       Active: active (exited) since Mon 2021-07-12 09:30:39 BST; 2s ago
      Process: 5458 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
     Main PID: 5458 (code=exited, status=0/SUCCESS)
    
  • Stop the service by running:

    sudo systemctl stop postgresql

  • Start the service by running:

    sudo systemctl start postgresql

  • Check and follow the service logs by running:

    sudo tail -500f /var/log/postgresql/postgresql-13-main.log

GeoServer 2.18.3

The geospatial server backend is provided by GeoServer 2.18.3 hosted by an instance of the Apache Tomcat 9.0.48 servlet application provider.

You can access the service interface by pointing the browser to:

http://localhost/geoserver

Start and Stop the Service

  • In order to check the service status run:

    sudo systemctl status tomcat9

    The system will print something like:

    ● tomcat9.service - Apache Tomcat Server
       Loaded: loaded (/lib/systemd/system/tomcat9.service; enabled; vendor preset: enabled)
       Active: active (running) since Mon 2021-07-12 09:41:44 BST; 2s ago
      Process: 6444 ExecStart=/opt/tomcat/latest/bin/startup.sh (code=exited, status=0/SUCCESS)
     Main PID: 6454 (java)
        Tasks: 17 (limit: 4652)
       Memory: 119.3M
       CGroup: /system.slice/tomcat9.service
               └─6454 /usr/lib/jvm/java-8-openjdk-amd64/jre//bin/java -Djava.util.logging.config.file=/opt/tomcat/latest/conf/logging.properties -Djava.util.logging.mana>
    
    Jul 12 09:41:44 geonodevm-3 systemd[1]: Starting Apache Tomcat Server...
    Jul 12 09:41:44 geonodevm-3 startup.sh[6444]: Existing PID file found during start.
    Jul 12 09:41:44 geonodevm-3 startup.sh[6444]: Removing/clearing stale PID file.
    Jul 12 09:41:44 geonodevm-3 startup.sh[6444]: Tomcat started.
    Jul 12 09:41:44 geonodevm-3 systemd[1]: Started Apache Tomcat Server.
    
  • Stop the service by running:

    sudo systemctl stop tomcat9

  • Start the service by running:

    sudo systemctl start tomcat9

  • Check and follow the service logs by running:

    sudo tail -500f /opt/data/geoserver_logs/geoserver.log

GeoServer DATA_DIR and JVM Options

The defailt GeoServer JVM Options (heap memory, logs and data dir locations, …) can be set by editing the following file:

sudo vim /opt/tomcat/latest/bin/setenv.sh

By default those options are set as follows:

JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/
GEOSERVER_DATA_DIR="/opt/data/geoserver_data"
GEOSERVER_LOG_LOCATION="/opt/data/geoserver_logs/geoserver.log"
GEOWEBCACHE_CACHE_DIR="/opt/data/gwc_cache_dir"
GEOFENCE_DIR="$GEOSERVER_DATA_DIR/geofence"
TIMEZONE="UTC"
JAVA_OPTS="-server -Djava.awt.headless=true -Dorg.geotools.shapefile.datetime=false -XX:+UseParallelGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Duser.timezone=$TIMEZONE -Xms512m -Xmx2048m -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://localhost:8080/geoserver/pdf -DGEOSERVER_DATA_DIR=$GEOSERVER_DATA_DIR -Dgeofence.dir=$GEOFENCE_DIR -DGEOSERVER_LOG_LOCATION=$GEOSERVER_LOG_LOCATION -DGEOWEBCACHE_CACHE_DIR=$GEOWEBCACHE_CACHE_DIR"

The default GEOSERVER_DATA_DIR, containing the GeoServer catalog, is set to:

GEOSERVER_DATA_DIR="/opt/data/geoserver_data"

NGINX 1.18.0 HTTPD Server

All the HTTP services are provided through an instance of the NGINX 1.18.0 HTTPD Server.

This service allows to proxy every HTTP based application through the http://localhost virtual host.

Start and Stop the Service

  • In order to check the service status run:

    sudo systemctl status nginx

    The system will print something like:

    ● nginx.service - A high performance web server and a reverse proxy server
       Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
       Active: active (running) since Mon 2021-07-12 09:05:30 BST; 45min ago
         Docs: man:nginx(8)
      Process: 636 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
      Process: 693 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
     Main PID: 705 (nginx)
        Tasks: 3 (limit: 4652)
       Memory: 11.2M
       CGroup: /system.slice/nginx.service
               ├─705 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
               ├─710 nginx: worker process
               └─711 nginx: worker process
    
    Jul 12 09:05:29 geonodevm-3 systemd[1]: Starting A high performance web server and a reverse proxy server...
    Jul 12 09:05:30 geonodevm-3 systemd[1]: Started A high performance web server and a reverse proxy server.
    
  • Stop the service by running:

    sudo systemctl stop nginx

  • Start the service by running:

    sudo systemctl start nginx

  • Check and follow the service logs by running:

    sudo tail -500f /var/log/nginx/access.log sudo tail -500f /var/log/nginx/error.log

NGINX localhost configuration files

  • The main configuration file can be edited by running the following command:

    sudo vim /etc/nginx/nginx.conf

  • The GeoNode/GeoServer configuration file can be edited by running the following command:

    sudo vim /etc/nginx/sites-enabled/geonode

GeoNode 3.3.x

GeoNode is provided by an instance of the UWSGI service.

You can access the GeoNode interface by pointing the browser to:

http://localhost/

GeoNode Source Code

  • Everytime touching the GeoNode source code, or any of its components, you must enable the correct VIRTUALENV. You can do that by running the following command:

    workon geonode

  • The GeoNode source code and settings are based on the following folder:

    cd /opt/geonode

  • The GeoNode current commit is set to b87472a44f8d5af75647620f6dcddd9164332d22 (HEAD -> 3.3.x, origin/3.3.x) - Thu Jul 8 17:06:37 2021 +0200.

  • You can check the GeoNode source code version and history by running the following command from the GeoNode source code folder:

    git log

Change the .env settings and restart GeoNode

  • The GeoNode settings are currently stored on a UWSGI ini file:

    sudo vim /etc/uwsgi/apps-enabled/geonode.ini

  • Whenever you need to change the settings and restart GeoNode, you can simply run the following command:

    touch /opt/geonode/geonode/wsgi.py

Update the GeoNode Statics Files (UI and clieng updates)

  • Whenever you need to the STATICS files of GeoNode, you can simply run the following command from the GeoNode source folder:

    ./manage_dev.sh collectstatic
    touch /opt/geonode/geonode/wsgi.py
    

GeoNode Logs

  • Follow the GeoNode log file by running the following command:

    sudo tail -500f /var/log/uwsgi/app/geonode.log