Skip to content

Instantly share code, notes, and snippets.

@walker
Forked from BerryDaniel/install.md
Created March 20, 2017 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walker/57d1dba1790e2e1cc2c7649b1439e415 to your computer and use it in GitHub Desktop.
Save walker/57d1dba1790e2e1cc2c7649b1439e415 to your computer and use it in GitHub Desktop.

Configuration

The installation is a two virtual machine setup.

  • Virtual Machine 1 (Applications)
  • Virtual Machine 2 (Services)

Disable the Red Hat Base repository

subscription-manager config --rhsm.manage_repos=0
service rhsmcertd stop
yum-config-manager --disable rhbase

Add the following repo file

vi /etc/yum.repos.d/exchange.repo
...
[exchange-development]
name=exchange
baseurl=https://s3.amazonaws.com/exchange-development-yum/el$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://s3.amazonaws.com/exchange-development-yum/exchange-gpg-key

[pgdg96]
name=PostgreSQL 9.6 $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-$releasever-$basearch
enabled=1
gpgpcheck=1
gpgkey=https://s3.amazonaws.com/exchange-development-yum/postgresql-gpg-key

[rhbase]
name=Red Hat Base 7.3
baseurl=https://s3.amazonaws.com/exchange-development-yum/base/el$releasever/$basearch
enabled=1
gpgcheck=0
...

Install and Configure Services (Virtual Machine 2)

sudo yum install boundless-postgis2_96 \
                 elasticsearch \
                 rabbitmq-server \
                 erlang \
                 java-1.8.0-openjdk
# configure postgresql
sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
sudo chkconfig postgresql-9.6 on
sudo sed -i.exchange 's/peer$/trust/g' /var/lib/pgsql/9.6/data/pg_hba.conf
sudo sed -i.exchange 's/ident$/md5/g' /var/lib/pgsql/9.6/data/pg_hba.conf
sudo vi /var/lib/pgsql/9.6/data/postgresql.conf
...
listen_addresses = '*'              # what IP address(es) to listen on;
...
sudo vi /var/lib/pgsql/9.6/data/pg_hba.conf
# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             10.130.170.15/32            md5 # <-- add this entry
# IPv6 local connections:
host    all             all             ::1/128                 md5
...
sudo service postgresql-9.6 restart

# create database instances
psql -U postgres -c "CREATE USER exchange WITH PASSWORD 'boundless';"
psql -U postgres -c "CREATE DATABASE exchange OWNER exchange;"
psql -U postgres -c "CREATE USER registry WITH PASSWORD 'boundless';"
psql -U postgres -c "CREATE DATABASE registry OWNER registry;"
psql -U postgres -c "CREATE DATABASE exchange_data OWNER exchange;"
psql -U postgres -d exchange_data -c 'CREATE EXTENSION postgis;'
psql -U postgres -d exchange_data -c 'GRANT ALL ON geometry_columns TO PUBLIC;'
psql -U postgres -d exchange_data -c 'GRANT ALL ON spatial_ref_sys TO PUBLIC;'

# configure elasticsearch
sudo chkconfig elasticsearch on
sudo service elasticsearch start

# configure rabbitmq-server
sudo chkconfig rabbitmq-server on
sudo service rabbitmq-server start
rabbitmqctl add_vhost exchange
rabbitmqctl add_user exchange boundless
rabbitmqctl set_permissions -p exchange exchange ".*" ".*" ".*"

Install and Configure Applications (Virtual Machine 1)

sudo yum install exchange \
                 registry \
                 geonode-geoserver
# configure registry
vi /etc/profile.d/registry-settings.sh
...
export REGISTRY_DEBUG=${REGISTRY_DEBUG:-'True'}
export REGISTRY_SECRET_KEY=${REGISTRY_SECRET_KEY:-'Make sure you create a good secret key.'}
export REGISTRY_MAPPING_PRECISION=${REGISTRY_MAPPING_PRECISION:-'500m'}
export REGISTRY_SEARCH_URL=${REGISTRY_SEARCH_URL:-'http://10.130.170.51:9200'}
export REGISTRY_DATABASE_URL=${REGISTRY_DATABASE_URL:-'postgres://registry:boundless@10.130.170.51:5432/registry'}
export MAPPROXY_CACHE_DIR=${MAPPROXY_CACHE_DIR:-'/tmp'}
export REGISTRY_ALLOWED_IPS=${REGISTRY_ALLOWED_IPS:-'*'}
...
sudo registry-createdb
sudo chkconfig registry on
sudo service registry restart

# configure exchange
vi /etc/profile.d/exchange-settings.sh
...
export SITEURL=${SITEURL:-'http://10.130.170.15'}
export ES_URL=${ES_URL:-'http://10.130.170.51:9200/'}
export LOCKDOWN_GEONODE=${LOCKDOWN_GEONODE:-'True'}
export BROKER_URL=${BROKER_URL:-'amqp://guest:guest@10.130.170.51:5672/'}
export DATABASE_URL=${DATABASE_URL:-'postgres://exchange:boundless@10.130.170.51:5432/exchange'}
export POSTGIS_URL=${POSTGIS_URL:-'postgis://exchange:boundless@10.130.170.51:5432/exchange_data'}
export GEOSERVER_URL=${GEOSERVER_URL:-'http://10.130.170.15/geoserver/'}
export GEOSERVER_DATA_DIR=${GEOSERVER_DATA_DIR:-'/opt/geonode/geoserver_data'}
export GEOSERVER_LOG=${GEOSERVER_LOG:-'/opt/geonode/geoserver_data/logs/geoserver.log'}
export GEOGIG_DATASTORE_DIR=${GEOGIG_DATASTORE_DIR:-'/opt/geonode/geoserver_data/geogig'}
export DJANGO_LOG_LEVEL=${DJANGO_LOG_LEVEL:-'ERROR'}
export STATIC_ROOT=${STATIC_ROOT:-'/opt/boundless/exchange/.storage/static'}
export STATIC_URL=${STATIC_URL:-'/static/'}
export MEDIA_ROOT=${MEDIA_ROOT:-'/opt/boundless/exchange/.storage/media'}
export MEDIA_URL=${MEDIA_URL:-'/media/'}
export DEBUG_STATIC=${DEBUG_STATIC:-'False'}
export ALLOWED_HOSTS=${ALLOWED_HOSTS:-"['*']"}
export LANGUAGE_CODE=${LANGUAGE_CODE:-'en-us'}
export SOCIAL_BUTTONS=${SOCIAL_BUTTONS:-'False'}
export SECRET_KEY=${SECRET_KEY:-'exchange@q(6+mnr&=jb@z#)e_cix10b497vzaav61=de5@m3ewcj9%ctc'}
export DEFAULT_ANONYMOUS_VIEW_PERMISSION=${DEFAULT_ANONYMOUS_VIEW_PERMISSION:-'False'}
export DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION=${DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION:-'False'}
export WGS84_MAP_CRS=${WGS84_MAP_CRS:-'False'}
export REGISTRYURL=${SITEURL:-'http://10.130.170.15/registry'}
...
sudo exchange-config django
sudo chkconfig exchange on
sudo service exchange restart

# configure geoserver
sudo vi /opt/geonode/geoserver_data/global.xml
....
<onlineResource>http://geoserver.org</onlineResource>
<proxyBaseUrl>http://10.130.170.15/geoserver/</proxyBaseUrl> # <-- add this entry
...
sudo vi /opt/geonode/geoserver_data/security/filter/geonode-oauth2/config.xml
....
<!-- GeoNode accessTokenUri -->
<accessTokenUri>http:/10.130.170.15/o/token/</accessTokenUri> # <-- modify this entry

<!-- GeoNode userAuthorizationUri -->
<userAuthorizationUri>http://10.130.170.15/o/authorize/</userAuthorizationUri> # <-- modify this entry

<!-- GeoServer Public URL -->
<redirectUri>http://10.130.170.15/geoserver</redirectUri> # <-- modify this entry

<!-- GeoNode checkTokenEndpointUrl -->
<checkTokenEndpointUrl>http://10.130.170.15/api/o/v4/tokeninfo/</checkTokenEndpointUrl> # <-- modify this entry

<!-- GeoNode logoutUri -->
<logoutUri>http://10.130.170.15/account/logout/</logoutUri> # <-- modify this entry
...
sudo vi /opt/geonode/geoserver_data/security/role/geonode\ REST\ role\ service/config.xml
....
<baseUrl>http://10.130.170.15</baseUrl> # <-- modify this entry
...
vi /var/lib/tomcat8/webapps/geoserver/WEB-INF/web.xml
...
    <!--  http session listener proxy -->
    <listener>
      <listener-class>org.geoserver.platform.GeoServerHttpSessionListenerProxy</listener-class>
    </listener>
    
    <!-- ADD the following listener-class if it does not exist -->
    <listener>
      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
...
sudo chkconfig tomcat8 on
sudo service tomcat8 restart

# configure apache httpd
sudo chkconfig httpd on
sudo service httpd restart

echo "access exchange at http://10.130.170.15"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment