Last active
February 9, 2017 09:40
-
-
Save daniviga/64385b68d27f25afd19ed2c60e682aaf to your computer and use it in GitHub Desktop.
Minimal GeoNode 2.5/master setup on Xenial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an LXC with Xenial | |
lxc-create -n genode25 -t ubuntu -- -r xenial | |
# Inside the LXC | |
## Pre-requisites | |
sudo apt update | |
sudo apt install -y git python-dev python-virtualenv libpq-dev libgdal-dev openjdk-8-jdk-headless | |
## Create the virtualenv | |
virtualenv ~/env | |
source ~/env/bin/activate | |
## Clone GeoNode | |
git clone https://github.com/GeoNode/geonode | |
## Install GeoNode and dependencies | |
cd geonode | |
pip install -e . | |
pip install pygdal==1.11.3.3 | |
## Set the local_settings.py | |
IP=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) | |
cat << EOF > geonode/local_settings.py | |
import os | |
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) | |
SITEURL = 'http://$IP:8000' | |
ALLOWED_HOSTS = ['$IP', 'localhost'] | |
GEOSERVER_LOCATION = 'http://$IP:8080/geoserver/' | |
GEOSERVER_PUBLIC_LOCATION = 'http://$IP:8080/geoserver/' | |
OGC_SERVER = { | |
'default': { | |
'BACKEND': 'geonode.geoserver', | |
'LOCATION': GEOSERVER_LOCATION, | |
'LOGIN_ENDPOINT': 'j_spring_oauth2_geonode_login', | |
'LOGOUT_ENDPOINT': 'j_spring_oauth2_geonode_logout', | |
# PUBLIC_LOCATION needs to be kept like this because in dev mode | |
# the proxy won't work and the integration tests will fail | |
# the entire block has to be overridden in the local_settings | |
'PUBLIC_LOCATION': GEOSERVER_PUBLIC_LOCATION, | |
'USER' : 'admin', | |
'PASSWORD' : 'geoserver', | |
'MAPFISH_PRINT_ENABLED' : True, | |
'PRINT_NG_ENABLED' : True, | |
'GEONODE_SECURITY_ENABLED' : True, | |
'GEOGIG_ENABLED' : False, | |
'WMST_ENABLED' : False, | |
'BACKEND_WRITE_ENABLED': True, | |
'WPS_ENABLED' : False, | |
'LOG_FILE': '%s/geoserver/data/logs/geoserver.log' % os.path.abspath(os.path.join(PROJECT_ROOT, os.pardir)), | |
# Set to dictionary identifier of database containing spatial data in DATABASES dictionary to enable | |
'DATASTORE': '', #'datastore', | |
} | |
} | |
EOF | |
## Run GeoNode | |
paver setup | |
paver sync | |
paver start -b 0.0.0.0:8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment