Skip to main content
Skip table of contents

Installation Guide

Table of Contents

Contact support@packetpower.com for local EMX installation support.

Hardware Requirements

Energy monitoring systems produce a high volume of data. It is important that the server EMX will be deployed on is sized correctly for this type of workload. In particular, the application's performance is heavily dependent on access to sufficient memory and the use of high-speed disk.

General guidelines

Monitoring Units

Gateways

Processor Cores

Memory (GB)

Disk Space (GB)

< 100

1 - 2

2

4 to 8

100

100 to 500

2 - 5

4

8 to 16

250

500 to 5,000

5 - 50

8

16 to 64

500+

For deployments over 5,000 monitoring units, please contact Packet Power support for sizing assistance.

Disk drives

The storage subsystem should:

  • be implemented in RAID 10 across multiple disks

  • consist of high throughput (10,000 RPM or solid state) drives, solid state HEAVILY recommended.

Server platform

  • Supported hardware environments:

    • Bare-metal

    • "Commercial" Virtual Machine platforms, such as: HyperV, KVM, OpenStack, VMWare ESX, VMWare vSphere, Xen

  • Unsupported virtual platforms:

    • All "Consumer" Virtual Machine platforms, such as: VirtualBox, Virtual PC, VMWare Player, VMWare Fusion

    • Certain virtualization platforms, such as: Open VZ, Parallels

Network connectivity

  • Between servers: 100Mbit - 1Gbit

  • Gateways to server: 1 Mbit - 10 Mbit

  • Hubs to server: 10 Mbit - 1Gbit

Software Requirements

Server OS

  • Linux Ubuntu 14.04/16.04 LTS

  • Linux RHEL 6.7/7, CentOS 6.7/7

Web Browsers

N-2 for Chrome, Firefox and Microsoft Edge/IE

Operating System

EMX supports the following operating systems at this time:

  • Ubuntu 14.04

  • Ubuntu 16.04

  • Ubuntu 22.04

  • RHEL/CentOS 6.7

  • RHEL/CentOS 7

RHEL / CentOS 6.7

System Configuration

We require that the timezone is configured to UTC.  If you have previously configured it to a timezone that was not UTC, please correct that by running the following command and restart the machine:

ln -sf /usr/share/zoneinfo/UTC /etc/localtime

 

3rd Party Repositories

EMX requires a few 3rd party repositories for installation. 

  • EPEL version 6.8

  • Remi version 6

  • MySQL version 5.7

Setting up the 3rd party repositories

# EPEL release 6.8

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -Uvh epel-release-6-8.noarch.rpm

  

# Remi release 6

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

rpm -Uvh remi-release-6.rpm

  

# MySQL release 5.7

wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm

rpm -Uvh mysql57-community-release-el6-7.noarch.rpm

 

Once the 3rd party repositories have been setup, it's time to install all of the pre-requisites:

yum install httpd php php-bcmath php-cli php-common php-devel php-intl php-mbstring php-mcrypt php-mysqlnd php-opcache php-pdo php-pecl-apcu php-pecl-jsonc php-snmp php-xml mysql-community-client policycoreutils-python

Setting up PHP

Once the packages have finished installing, you will need to configure the PHP timezone.  We do this by adding a new file to the configuration:

echo 'date.timezone = UTC' > /etc/php.d/00-datetime.ini

echo 'date.timezone = UTC' > /etc/php-zts.d/00-datetime.ini

 

EMX also requires one additional extension to be installed that is utilized to read the EMX source code:

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

tar -zxf ioncube_loaders_lin_x86-64.tar.gz

cp ioncube/ioncube_loader_lin_5.6.so /usr/lib64/php/modules/

echo 'zend_extension=ioncube_loader_lin_5.6.so' > /etc/php-zts.d/05-ioncube.ini

echo 'zend_extension=ioncube_loader_lin_5.6.so' > /etc/php.d/05-ioncube.ini

Setting up Apache

EMX will need a site available and leverages the /var/www directory.  We need this directory to be cleaned out as EMX will take it over during it's installation.  This is why you must run EMX on a dedicated host.

# Setup the directory access

rm -rf /var/www

mkdir /var/www

chown apache.apache /var/www

  

# Setup SElinux permissions

semanage fcontext -a -t httpd_sys_content_t "/var/www(/.*)?"

restorecon -R -v /var/www

setsebool -P httpd_can_network_connect=1

setsebool -P httpd_can_network_connect_db 1

setsebool -P httpd_can_sendmail 1

  

# Configure apache sites

rm -f /etc/httpd/conf.d/welcome.conf

cat <<EOT > /etc/httpd/conf.d/emx.conf

<VirtualHost *:80>

 ServerName default

 DocumentRoot "/var/www"

 <Directory "/var/www">

 Options Indexes FollowSymLinks

 AllowOverride All

 DirectoryIndex index.php

 </Directory>

 ErrorLog "/var/log/httpd/emx_error.log"

 ServerSignature Off

 CustomLog "/var/log/httpd/emx_access.log" combined

</VirtualHost>

EOT

  

# restart apache

service httpd restart

 

Setting up MySQL

MySQL is a requirement for EMX, however, it does not need to live on the same machine and is not recommended for large installations.  If you have a MySQL database server already up and running, you can skip the installation but review the requirements on your existing database server.

Requirements

We require a few specific MySQL settings to ensure EMX operates properly.

  • Event Scheduler must be turned ON (event-scheduler = on)

  • InnoDB file per table must be turned ON (innodb-file-per-table = on)

  • Port must run on 3306

Installation

You can install the database server through yum and configure the my.cnf file with the following commands:

yum install mysql-community-server

cat <<EOT >> /etc/my.cnf

innodb-file-per-table = on

event-scheduler = on

sql-mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

EOT

service mysqld restart

 

Configuring MySQL Access

EMX will need it's own user and database schema which it will utilize once the system has been configured. However, first we will need to set a password on the root account.  MySQL auto-generated a password for us, but it must be reset to continue.  Password requirements are a minimum of 8 characters in length with 1 mixed case, 1 number and 1 special character.

# Reset the MySQL password

grep 'temporary password' /var/log/mysqld.log

# Login to MySQL

mysql -uroot -p

 

# Change the root password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewP4ssword$';

 

# Create an EMX user

CREATE USER 'emx'@'localhost' IDENTIFIED BY 'S3cretP4ssword$';

GRANT ALL PRIVILEGES ON `emx`.* TO 'emx'@'localhost';

 

# Create an EMX database

CREATE DATABASE `emx`;

 

exit

 

Setting up EMX

Once you have received the download link for the RPM file, you can install it by running:

wget DOWNLOAD_LINK

rpm -Uvh packetpower-emx-*.rpm

 

Once this is installed, navigate on your web browser to the IP address of the server.

 

RHEL / CentOS 7 & 7.3

System Configuration

We require that the timezone is configured to UTC.  If you have previously configured it to a timezone that was not UTC, please correct that by running the following command and restart the machine:

ln -sf /usr/share/zoneinfo/UTC /etc/localtime

 

3rd Party Repositories

EMX requires a few 3rd party repositories for installation. 

  • EPEL version 7.9

  • Remi version 7

  • MySQL version 5.7

Setting up the 3rd party repositories

# EPEL release 7.9

wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

rpm -Uvh epel-release-7-9.noarch.rpm

 

# REMI release 7

wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

rpm -Uvh remi-release-7.rpm

 

# MySQL release 5.7

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

rpm -Uvh mysql57-community-release-el7-8.noarch.rpm

 

Once the 3rd party repositories have been setup, it's time to install all of the pre-requisites:

yum --enablerepo=remi-php56 install httpd php php-bcmath php-cli php-common php-devel php-intl php-mbstring php-mcrypt php-mysqlnd php-opcache php-pdo php-pecl-apcu php-pecl-jsonc php-snmp php-xml mysql-community-client policycoreutils-python

Setting up PHP

Once the packages have finished installing, you will need to configure the PHP timezone.  We do this by adding a new file to the configuration:

echo 'date.timezone = UTC' > /etc/php.d/00-datetime.ini

echo 'date.timezone = UTC' > /etc/php-zts.d/00-datetime.ini

 

EMX also requires one additional extension to be installed that is utilized to read the EMX source code:

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

tar -zxf ioncube_loaders_lin_x86-64.tar.gz

cp ioncube/ioncube_loader_lin_5.6.so /usr/lib64/php/modules/

echo 'zend_extension=ioncube_loader_lin_5.6.so' > /etc/php-zts.d/05-ioncube.ini

echo 'zend_extension=ioncube_loader_lin_5.6.so' > /etc/php.d/05-ioncube.ini

Setting up Apache

EMX will need a site available and leverages the /var/www directory.  We need this directory to be cleaned out as EMX will take it over during it's installation.  This is why you must run EMX on a dedicated host.

# Setup the directory access

rm -rf /var/www

mkdir /var/www

chown apache.apache /var/www

sed -i'' 's#/var/www/html#/var/www#g' /etc/httpd/conf/httpd.conf

  

# Setup SElinux permissions

semanage fcontext -a -t httpd_sys_content_t "/var/www(/.*)?"

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/config.php"

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/uploads(/.*)?"

restorecon -R -v /var/www

setsebool -P httpd_can_network_connect=1

setsebool -P httpd_can_network_connect_db 1

setsebool -P httpd_can_sendmail 1

setsebool -P httpd_unified 1

  

# Configure apache sites

rm -f /etc/httpd/conf.d/welcome.conf

cat <<EOT > /etc/httpd/conf.d/emx.conf

<VirtualHost *:80>

 ServerName default

 DocumentRoot "/var/www"

 <Directory "/var/www">

 Options Indexes FollowSymLinks

 AllowOverride All

 DirectoryIndex index.php

 </Directory>

 ErrorLog "/var/log/httpd/emx_error.log"

 ServerSignature Off

 CustomLog "/var/log/httpd/emx_access.log" combined

</VirtualHost>

EOT

 

# setup firewall rules to allow HTTP/HTTPS

iptables -I INPUT 2 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

iptables -I INPUT 2 -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

 

# restart apache

service httpd restart

 

Setting up MySQL

MySQL is a requirement for EMX, however, it does not need to live on the same machine and is not recommended for large installations.  If you have a MySQL database server already up and running, you can skip the installation but review the requirements on your existing database server.

Requirements

We require a few specific MySQL settings to ensure EMX operates properly.

  • Event Scheduler must be turned ON (event-scheduler = on)

  • InnoDB file per table must be turned ON (innodb-file-per-table = on)

  • Port must run on 3306

Installation

You can install the database server through yum and configure the my.cnf file with the following commands:

yum install mysql-community-server

cat <<EOT >> /etc/my.cnf

innodb-file-per-table = on

event-scheduler = on

sql-mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

EOT

service mysqld restart

 

Configuring MySQL Access

EMX will need it's own user and database schema which it will utilize once the system has been configured. However, first we will need to set a password on the root account.  MySQL auto-generated a password for us, but it must be reset to continue.  Password requirements are a minimum of 8 characters in length with 1 mixed case, 1 number and 1 special character.

# Reset the MySQL password

grep 'temporary password' /var/log/mysqld.log

# Login to MySQL

mysql -uroot -p

 

# Change the root password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewP4ssword$';

 

# Create an EMX user

CREATE USER 'emx'@'localhost' IDENTIFIED BY 'S3cretP4ssword$';

GRANT ALL PRIVILEGES ON `emx`.* TO 'emx'@'localhost';

 

# Create an EMX database

CREATE DATABASE `emx`;

 

exit

 

Setting up EMX

Once you have received the download link for the RPM file, you can install it by running:

wget DOWNLOAD_LINK

rpm -Uvh packetpower-emx-*.rpm

  

touch /var/www/config.php

chown apache.apache /var/www/config.php

restorecon -R -v /var/www

Once this is installed, navigate on your web browser to the IP address of the server. 

Ubuntu 14.04

System Configuration

We require that the timezone is configured to UTC.  If you have previously configured it to a timezone that was not UTC, please correct that by running the following command and restart the machine:

timedatectl set-timezone UTC

 

3rd Party Repositories

EMX requires a few 3rd party repositories for installation. 

MySQL version 5.7

Setting up the 3rd party repositories

# MySQL

wget https://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb

dpkg -i mysql-apt-config_0.7.3-1_all.deb

# accept defaults when prompted by pressing the down arrow to "OK" and pressing enter.

 

Once the 3rd party repositories have been setup, it's time to install all of the pre-requisites:

apt-get update

apt-get install -y apache2 libapache2-mod-php5 snmp php5 php5-cli php5-common php5-curl php5-json php5-intl php5-dev php5-mcrypt php5-mysql php5-snmp

Setting up PHP

Once the packages have finished installing, you will need to configure the PHP timezone.  We do this by adding a new file to the configuration:

echo 'date.timezone = UTC' > /etc/php5/mods-available/date.ini

 

EMX also requires one additional extension to be installed that is utilized to read the EMX source code:

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

tar -zxf ioncube_loaders_lin_x86-64.tar.gz

cp ioncube/ioncube_loader_lin_5.5.so `php -i | grep extension_dir | awk '{print $3}'`

cat <<EOF > /etc/php5/mods-available/ioncube.ini

; configuration for ioncube module

; priority=01

zend_extension=ioncube_loader_lin_5.5.so

EOF

Finally, enable the installed extensions:

php5enmod date

php5enmod mcrypt

php5enmod ioncube

Setting up Apache

EMX will need a site available and leverages the /var/www directory.  We need this directory to be cleaned out as EMX will take it over during it's installation.  This is why you must run EMX on a dedicated host.

# Remove existing sites

rm -rf /etc/apache2/sites-enabled/*

rm -rf /etc/apache2/sites-available/*

  

# Clean the www directory

rm -rf /var/www

mkdir /var/www

chown www-data:www-data /var/www

  

# Setup the site

cat <<EOT > /etc/apache2/sites-available/emx.conf

<VirtualHost *:80>

 ServerName default

 DocumentRoot "/var/www"

 <Directory "/var/www">

 Options Indexes FollowSymLinks

 AllowOverride All

 DirectoryIndex index.php

 </Directory>

 ErrorLog "/var/log/apache2/emx_error.log"

 ServerSignature Off

 CustomLog "/var/log/apache2/emx_access.log" combined

</VirtualHost>

EOT

 

# Enable the rewrite module and emx site

a2enmod rewrite

a2ensite emx

service apache2 restart

 

Setting up MySQL

MySQL is a requirement for EMX, however, it does not need to live on the same machine and is not recommended for large installations.  If you have a MySQL database server already up and running, you can skip the installation but review the requirements on your existing database server.

Requirements

We require a few specific MySQL settings to ensure EMX operates properly.

  • Event Scheduler must be turned ON (event-scheduler = on)

  • InnoDB file per table must be turned ON (innodb-file-per-table = on)

  • Port must run on 3306

Installation

You can install the database server through yum and configure the my.cnf file with the following commands:

# Install mysql

apt-get install -y mysql-server mysql-client

 

 

# Handling EMX mysql configuration

cat <<EOT >> /etc/mysql/conf.d/emx.cnf

[mysqld]

innodb-file-per-table = on

event-scheduler = on

sql-mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

EOT

 

 

service mysql restart

Configuring MySQL Access

EMX will need it's own user and database schema which it will utilize once the system has been configured.

# Login to MySQL

mysql -uroot

 

# Create an EMX user

CREATE USER 'emx'@'localhost' IDENTIFIED BY 'S3cretP4ssword$';

GRANT ALL PRIVILEGES ON `emx`.* TO 'emx'@'localhost';

 

# Create an EMX database

CREATE DATABASE `emx`;

 

exit

 

Setting up EMX

# Enable the apt repository

apt-key adv --keyserver pgp.mit.edu --recv 7E3AEE6F

echo 'deb http://deb.packetpower.com stable main' > /etc/apt/sources.list.d/packetpower.list

  

# Install EMX

apt-get update

apt-get install packetpower-emx

 

 

# Setup permissions for installer

touch /var/www/config.php

chown www-data:www-data /var/www/config.php

mkdir -p /var/www/uploads

chown www-data:www-data /var/www/uploads

chmod 0775 /var/www/uploads

 

Once this is installed, navigate on your web browser to the IP address of the server.

Ubuntu 16.04

Note: Some of the commands in this guide may need to be run by a user with elevated privileges.

System Configuration

We require that the timezone is configured to UTC.  If you have previously configured it to a timezone that was not UTC, please correct that by running the following command and restart the machine:

timedatectl set-timezone UTC

3rd Party Repositories

EMX requires a few 3rd party repositories for installation. 

MySQL version 5.7

Setting up the 3rd party repositories

# MySQL

wget https://dev.mysql.com/get/mysql-apt-config_0.8.6-1_all.deb

dpkg -i mysql-apt-config_0.8.6-1_all.deb

# accept defaults when prompted by pressing the down arrow to "OK" and pressing enter.

 

Once the 3rd party repositories have been setup, it's time to install all of the pre-requisites:

apt update

apt install -y apache2 php php7.0-bcmath php7.0-zip

Setting up Apache

EMX will need a site available and leverages the /var/www directory.  We need this directory to be cleaned out as EMX will take it over during it's installation.  This is why you must run EMX on a dedicated host.

# Remove existing sites

rm -rf /etc/apache2/sites-enabled/*

rm -rf /etc/apache2/sites-available/*

  

# Clean the www directory

rm -rf /var/www

mkdir /var/www

chown www-data:www-data /var/www

  

# Setup the site

cat <<EOT > /etc/apache2/sites-available/emx.conf

<VirtualHost *:80>

 ServerName default

 DocumentRoot "/var/www"

 <Directory "/var/www">

 Options Indexes FollowSymLinks

 AllowOverride All

 DirectoryIndex index.php

 </Directory>

 ErrorLog "/var/log/apache2/emx_error.log"

 ServerSignature Off

 CustomLog "/var/log/apache2/emx_access.log" combined

</VirtualHost>

EOT

 

# Enable the rewrite module and emx site

a2enmod rewrite

a2ensite emx

 

Setting up MySQL

MySQL is a requirement for EMX, however, it does not need to live on the same machine and is not recommended for large installations.  If you have a MySQL database server already up and running, you can skip the installation but review the requirements on your existing database server.

Requirements

We require a few specific MySQL settings to ensure EMX operates properly.

  • Event Scheduler must be turned ON (event-scheduler = on)

  • InnoDB file per table must be turned ON (innodb-file-per-table = on)

  • Port must run on 3306

Installation

You can install the database server through yum and configure the my.cnf file with the following commands:

# Install mysql

apt-get install -y mysql-server mysql-client

 

 

# Handling EMX mysql configuration

cat <<EOT >> /etc/mysql/conf.d/emx.cnf

[mysqld]

innodb-file-per-table = on

event-scheduler = on

sql-mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

EOT

 

 

service mysql restart

Configuring MySQL Access

EMX will need it's own user and database schema which it will utilize once the system has been configured.

# Login to MySQL

mysql -uroot -p

 

# Create an EMX user

CREATE USER 'emx'@'localhost' IDENTIFIED BY 'S3cretP4ssword$';

GRANT ALL PRIVILEGES ON `emx`.* TO 'emx'@'localhost';

 

# Create an EMX database

CREATE DATABASE `emx`;

 

exit


Setting up EMX

# Enable the Packet Power apt repository

apt-key adv --keyserver pgp.mit.edu --recv 7E3AEE6F

echo 'deb http://deb.packetpower.com xenial main' > /etc/apt/sources.list.d/packetpower.list

  

 

# Install EMX

apt update

apt install -y packetpower-emx

 

 

# Configure PHP timezone to be set to UTC

echo 'date.timezone = UTC' > /etc/php/7.0/mods-available/date.ini

phpenmod date

 

 

# Running EMX requires an additional PHP extension

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

tar -zxf ioncube_loaders_lin_x86-64.tar.gz

cp ioncube/ioncube_loader_lin_7.0.so `php -i | grep ^extension_dir | awk '{print $3}'`

cat <<EOF > /etc/php/7.0/mods-available/ioncube.ini

; configuration for ioncube module

; priority=01

zend_extension=ioncube_loader_lin_7.0.so

EOF

phpenmod ioncube

 

 

# Setup permissions for installer

touch /var/www/config.php

chown www-data:www-data /var/www/config.php

mkdir -p /var/www/uploads

chown www-data:www-data /var/www/uploads

chmod 0775 /var/www/uploads

 

# Restart Apache

service apache2 restart

Navigate on your web browser to the IP address of the server to complete the setup.

Ubuntu 22.04

See installation Guide below:

EMX-EMXLocal3.7InstallationGuide-Ubuntu22.04-200623-1951.pdf

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.