Skip to content

Installing the EMF on Linux

Catherine Seppanen edited this page Jan 29, 2019 · 3 revisions

The following instructions are for CentOS 7. For other Linux distributions, you'll need to use the appropriate package manager commands (yum, dnf, apt).

Install required packages

Java 8

sudo yum install java-1.8.0-openjdk

Postgres (any version between 9.2 and 9.6)

sudo yum install postgresql-server
sudo postgresql-setup initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql

Enable password authentication for database connections. Change ident to md5.

sudo vi /var/lib/pgsql/data/pg_hba.conf
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
sudo systemctl reload postgresql

Tomcat 8.5

See https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7

Download the EMF installation package

Visit https://cmascenter.org/cost/ and download the latest version of CoST/EMF. On the downloads page, look for the file labeled "CoST/EMF Windows Installation (Zip file)".

cd /opt
sudo mkdir emf
sudo chown <your username> emf
cd emf
curl -LO https://github.com/USEPA-OAQPS/emf/releases/download/redeploy_EPA_20180816/emf_state_install_20180829.zip
unzip emf_state_install_20180829.zip

Create the EMF Postgres database

sudo su postgres
psql -d postgres -c "CREATE ROLE emf WITH LOGIN SUPERUSER PASSWORD 'emf';"
exit
createdb -h 127.0.0.1 -U emf -E UTF8 EMF
psql -h 127.0.0.1 -U emf -d EMF -f state_install/database_backup/EMF_States_Version.backup -o EMF_State_Install_log.txt
psql -h 127.0.0.1 -U emf -d EMF -c "update emf.properties set value='/usr/bin/' where name='postgres-bin-dir';"
psql -h 127.0.0.1 -U emf -d EMF -c "update emf.properties set value='/opt/emf/data' where name='ImportExportTempDir';"
psql -h 127.0.0.1 -U emf -d EMF -c "update emf.properties set value='/opt/emf/data' where name='COST_CMDB_BACKUP_FOLDER';"
psql -h 127.0.0.1 -U emf -d EMF -c "update emf.properties set value='/opt/tomcat/webapps/exports' where name='DOWNLOAD_EXPORT_FOLDER';"
psql -h 127.0.0.1 -U emf -d EMF -c "update emf.properties set value='/opt/emf/data' where name='postgres-backup-dir-for-emissions-schema';"

Install the EMF Server

sudo systemctl stop tomcat
sudo cp state_install/EMF_Server/emf_v3.2.war /opt/tomcat/webapps/emf.war
sudo cp state_install/postgresql/postgresql-9.4-1201.jdbc41.jar /opt/tomcat/lib
sudo systemctl start tomcat

Launch the EMF Client

cd state_install/EMF_Client
./EMFClient.sh

Running the EMF Client on other machines

The EMF Client is a Java program that can be run on Windows, macOS, or Linux. Java 8 must be installed on any computer that will run the EMF Client. To install the client, copy the state_install/EMF_Client directory to the computer.

On Windows, edit the file EMFClient.bat and update the following lines to match where the EMF Client is located (EMF_HOME) and the path to where Java is installed (JAVA_EXE). For the TOMCAT_SERVER setting, replace localhost with the IP address of the Linux machine running the EMF Server.

set EMF_HOME="C:\Users\Public\EMF"

set JAVA_EXE=C:\Program Files\Java\jre1.8.0_161\bin\java

set TOMCAT_SERVER=http://localhost:8080

On Linux or macOS, edit the file EMFClient.sh and update the TOMCAT_SERVER setting with the IP address of the Linux machine running the EMF Server.

export TOMCAT_SERVER=http://localhost:8080

Clone this wiki locally