-
-
Save cassioeskelsen/a2ba3bd34e7c059bee83 to your computer and use it in GitHub Desktop.
Installation of GeoNode 2.0 pre
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
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get update | |
sudo apt-get install postgis python-pycsw nginx uwsgi uwsgi-plugin-python virtualenvwrapper python-dev python-imaging python-psycopg2 | |
sudo apt-get install git | |
# Create geonode system user | |
sudo adduser --system --quiet --home /var/lib/geonode --no-create-home --shell /bin/bash --group --gecos "GeoNode administrator" geonode | |
sudo mkdir -p /var/lib/geonode | |
sudo chown geonode:geonode /var/lib/geonode | |
# Create database user for geonode | |
sudo -u postgres createuser geonode --no-createdb --no-superuser --no-createrole | |
sudo -u postgres createdb geonode -O geonode | |
sudo -u postgres createdb geoserver_config -O geonode | |
sudo -u postgres createdb geonode_data -O geonode | |
sudo -u postgres psql -c "CREATE EXTENSION postgis;" -d geonode_data | |
sudo -u postgres psql -c "CREATE EXTENSION postgis_topology;" -d geonode_data | |
## Continue the installation in user mode | |
sudo su - geonode | |
# Create virtualenv and activate it | |
mkvirtualenv geonode --system-site-packages | |
workon geonode | |
# Install geonode from pypi (or sources) | |
pip install -e git+https://github.com/GeoNode/geonode.git#egg=geonode | |
server { | |
listen 80; | |
server_name geonode; | |
access_log /var/log/nginx/geonode_access.log; | |
error_log /var/log/nginx/geonode_error.log; | |
location / { | |
uwsgi_pass unix:///tmp/geonode.sock; | |
include uwsgi_params; | |
} | |
location /media/ { | |
alias /var/lib/geonode/media/; | |
} | |
location /static/ { | |
alias /var/lib/geonode/static/; | |
} | |
} | |
sudo ln -s /etc/nginx/sites-available/geonode /etc/nginx/sites-enabled/geonode | |
[uwsgi] | |
vhost = true | |
plugins = python | |
master = true | |
enable-threads = true | |
uid=geonode | |
wsgi-file = /var/lib/geonode/.virtualenvs/geonode/src/geonode/geonode/wsgi.py | |
virtualenv = /var/lib/geonode/.virtualenvs/geonode | |
sudo ln -s /etc/uwsgi/apps-available/geonode.ini /etc/uwsgi/apps-enabled/geonode.ini | |
sudo service uwsgi restart | |
sudo service nginx restart | |
sudo su - geonode | |
workon geonode | |
django-admin.py syncdb --settings=geonode.settings --all | |
mkdir /var/lib/geonode/static | |
mkdir /var/lib/geonode/media | |
local_settings.py | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'geonode', | |
'USER': 'geonode', | |
} | |
} | |
# GeoNode vector data backend configuration. | |
#Import uploaded shapefiles into a database such as PostGIS? | |
DB_DATASTORE = True | |
#Database datastore connection settings | |
DB_DATASTORE_DATABASE = 'geonode_data' | |
DB_DATASTORE_USER = 'geonode' | |
DB_DATASTORE_PASSWORD = 'geonode' | |
DB_DATASTORE_HOST = 'localhost' | |
DB_DATASTORE_PORT = '5432' | |
DB_DATASTORE_TYPE = 'postgis' | |
DB_DATASTORE_NAME = 'geonode_data' | |
STATIC_ROOT = '/var/lib/geonode/static' | |
MEDIA_ROOT = '/var/lib/geonode/media' | |
sudo apt-get install tomcat7 | |
# Download geoserver and put it in /usr/share | |
wget http://downloads.sourceforge.net/geoserver/geoserver-2.3.0-war.zip | |
unzip geoserver-2.3.0-war.zip | |
mv geoserver.war geoserver.zip | |
sudo mkdir /usr/share/geoserver | |
sudo unzip geoserver.zip -d /usr/share/geoserver | |
# Install geoserver in Tomcat | |
echo '<Context path="/geoserver" docBase="/usr/share/geoserver/" />' | sudo tee /etc/tomcat7/Catalina/localhost/geoserver.xml > /dev/null | |
sudo chown -R tomcat7:tomcat7 /usr/share/geoserver/ | |
sudo service tomcat7 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment