-
Notifications
You must be signed in to change notification settings - Fork 13
Setting up AODN stack without Chef
Example OS: RHEL 7
sudo su
(become root)
Begin by cleaning up installed packages and update:
yum clean all
Install JDK 1.7 (best compatibility with AODN stack, can use 1.8 if required) and tomcat
yum install java-1.7.0-openjdk-devel
yum install tomcat
Edit tomcat configuration files and set memory requirements
vi /usr/share/tomcat/conf/tomcat.conf
Edit the line JAVA_OPTS as follows:
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx1024m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC"
By default, the tomcat webapps directory is /usr/share/tomcat/webapps
Install tomcat web manager GUI (optional, but useful)
yum install tomcat-admin-webapps
Edit the password for the web manager
vi /usr/share/tomcat/conf/tomcat-users.xml
Replace tomcat users with
<tomcat-users> <user username="admin" password="mycleverpassword" roles="manager-gui,admin-gui"/> </tomcat-users>
so can access the web admin at http://ip-address:8080/manager/html
, where ip-address is the ip of the tomcat server
Control tomcat as a service using:
sudo systemctl start tomcat
sudo systemctl stop tomcat
sudo systemctl restart tomcat
sudo systemctl enable tomcat
These commands will restart/stop/start/enable the AODN stack
Install Apache 2 as a webserver frontend
yum install httpd
Install postgresql server
yum install postgresql-server postgresql-contrib
Set postgres to require passwords for the db
vi /var/lib/pgsql/data/pg_hba.conf
and edit the lines
host all all 127.0.0.1/32 md5 <- change to host all all ::1/128 md5 <- change to
These commands will start/stop/enable the database
sudo systemctl start postgresql
sudo systemctl postgresql
sudo systemctl enable postgresql
Now we need to create a database for Geoserver and install the postgis extension
yum install postgis2_93
(this will install postgis for Postgres 9.3. Adjust version for the version of postgres that was installed earlier)
sudo su - postgres
(become postgres user)
psql
(enter postgres db prompt)
CREATE DATABASE geoserver ;
(or whatever name is required)
\c geoserver
CREATE EXTENSION postgis ;
Create db role with password and grant access privileges
CREATE ROLE geoserver_postgres WITH LOGIN PASSWORD mysmartpassword ;
GRANT ALL PRIVILEGES on geoserver TO geoserver_postgres ;
Now we need to install the AODN tomcat webapps
Go to http://imos-binary.s3-website-ap-southeast-2.amazonaws.com/?prefix=jobs/ and download the latest artifacts for geoserver_prod, geonetwork_prod and portal_4_prod.
Copy the artifacts to /usr/share/tomcat/webapps
and set the permissions on each to 755.
Tomcat should automatically unpack the wars and start the webapps.
Log files are in /usr/share/tomcat/logs
. The primary log file is catalina.out
Create a folder to contain the geonetwork and portal configuration files:
In this case, the folders have been created at /usr/share/tomcat/geonetwork_config
and /usr/share/tomcat/portal_config
.
Create the geonetwork config-overrides.xml file as per https://github.com/aodn/aodn-portal/wiki/Geonetwork-Branding. Place the config overrides file in the directory /usr/share/tomcat/geonetwork_config
The JAVA_OPTS in the tomcat config will need to be modified to pick up the geonetwork config overrides:
Add the line -Dgeonetwork.jeeves.configuration.overrides.file=/usr/share/tomcat/geonetwork_config/config-overrides.xml
. Note the path to the config overrides xml file.
To set the Geoserver data directory, add the line -DGEOSERVER_DATA_DIR=/usr/share/tomcat/webapps/geoserver/data
to the JAVA_OPTS variable and restart tomcat to apply the changes. Note that this is the default location for the geoserver data directory and can be modified to another location on disk.