GUI Node Installation

Overall Installation Steps

The high-level steps for installing and configuring the N2CUG administrative GUI are:

  1. Determine the server(s) that will supply the GUI logical component, bearing in mind the supported operating systems and minimum server requirements.
  2. Ensure the installation pre-requisites are met.
  3. Install the GUI package.
  4. Perform any required post-installation steps.
  5. Update the administrative GUI configuration as desired.
  6. Optionally, apply the recommended Apache security configuration.

Installation Pre-requisites

OS-specific Setup

Refer to the specific Red Hat or Debian instructions for any pre-requisites as required.

Apache 2

Apache 2 must be installed prior to installing the N2CUG GUI package. The package to install will depend on your OS type:

RHEL 8 Other RPM-based Systems DEB-based Systems
sudo dnf install httpd sudo yum install httpd sudo apt-get install apache2

The N2CUG GUI package expects that the relevant Apache 2 configuration directory exists. Again, this varies depending on your OS type:

RPM-based Systems DEB-based Systems
/etc/httpd /etc/apache2

Finally, the apachectl program must exist (it is installed as part of the Apache 2 package) and Apache must be running.

Installation Steps

Follow the appropriate installation steps depending on your installation sources.

From N-Squared Repository

Execute the instructions specific to your operating system:

RHEL 8 Other RPM-based Systems DEB-based Systems
sudo dnf install n2cug-gui sudo yum install n2cug-gui sudo apt-get install n2cug-gui

As Manual Installation

Transfer the provided package file to the target node, then follow the instructions specific to your operating system.

Execute (adjusting as appropriate for package location and version details) the following:

RPM-based Systems DEB-based Systems
sudo rpm -Uvh /path/to/n2cug-gui-M.m.p-b.noarch.rpm sudo dpkg -i /path/to/n2cug-gui_M.m.p-b_all.deb

Post-Installation Steps

Default Application

After installation, there is no default behaviour for Apache to automatically navigate to the N2CUG GUI when a site root request is received.

To set the N2CUG GUI as the default application, edit the appropriate file for your OS type:

RPM-based Systems DEB-based Systems
/etc/httpd/n2cug.conf /etc/apache2/n2cug.conf

Add the following line to the top of the file:

RedirectMatch ^/$ /n2cug

Restart Apache to apply the change:

apachectl restart

API Integration

The installed configuration files for the GUI assume that the API is co-installed on the GUI node. These files may therefore require updating in other installation topographies.

If more than one API instance is used, it is expected that some form of load-balancing is used to select an API instance for each API query (e.g. a VIP address, or DNS or other load-balancing proxy). The load-balancing address is then used as the configured address for all API requests from the GUI.

In single API instances where co-hosting is not used, the remote API address must be used as the configured address for API requests.

To update the API address for the N2CUG GUI, edit the following file:

RPM-based Systems DEB-based Systems
/etc/httpd/conf.d/n2cug.conf /etc/apache2/conf-enabled/n2cug.conf

In the file, update the value REPLACE_WITH_API_ADDRESS to the API instance or loadshare proxy destination as required in the below lines:

# Proxy keepalive requests.
ProxyPass        /n2acd-admin/keepalive    http://REPLACE_WITH_API_ADDRESS/jarvis-agent/n2cug/__status
ProxyPassReverse /n2acd-admin/keepalive    http://REPLACE_WITH_API_ADDRESS/jarvis-agent/n2cug/__status

# Proxy all Jarvis requests.
ProxyPass        /n2cug/jarvis-agent       http://REPLACE_WITH_API_ADDRESS/jarvis-agent
ProxyPassReverse /n2cug/jarvis-agent       http://REPLACE_WITH_API_ADDRESS/jarvis-agent

# Proxy management Jarvis requests if required.
#ProxyPass        /jarvis-agent             http://REPLACE_WITH_API_ADDRESS/jarvis-agent
#ProxyPassReverse /jarvis-agent             http://REPLACE_WITH_API_ADDRESS/jarvis-agent

If the GUI node is not on the same node as the API, uncomment the final two lines in the above section. These should remain commented for co-hosted installations of the GUI and API to avoid infinite looping.

Jarvis Configuration

If the N2CUG API is not co-located with the GUI node, in the file /usr/share/n2cug/gui/jarvis-proxy.json, locate the following section:

{
  "/jarvis-agent": {
    "target": "http://jarvis-host/",
    "secure": false
  }
}

Update the value of the target parameter to match the N2CUG API address. Alternately, you may add an entry to the GUI node’s hosts file or DNS lookups to redirect jarvis-host to the API as desired.

Firewall

The firewall (if any) on the GUI node must be updated to allow:

The exact commands to do this will depend both on the firewall on your platform and also which port(s) are in use. For example, to allow the default Apache ports when using firewalld, the commands might be:

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
service firewalld restart

SELinux

If SELinux is in use, Apache must be allowed to read and execute back-end code and initiate proxy connections. To enable this, execute:

sudo setsebool -P httpd_can_network_connect 1
sudo setsebool -P httpd_read_user_content 1